Re: [R] howto get significant digits for round()

2008-05-14 Thread Don MacQueen
I must say, I can't deduce, from what you have said, what the desired rounding rule is. The following function does not do what you want, but maybe it's a little bit related... rounds function (x, val = 1) val * round(x/val) If length = 12.2232 and delta-length = 0.4 (delt

[R] howto get significant digits for round()

2008-05-14 Thread Jonas Stein
i have a table like this of an value and its tolerance length delta-length 12.2232 0.4 123.422 0.034123 1234 12 i want to round the value to the significant digits in this way: my-round(length,delta-length) 12.2 , 0.4 123.42 , 0.03 1234 , 12 how can i do this with R? please CC