Re: [R] Number of digits of a value for problem 7.31 RFAQ SOLVED not really

2008-02-18 Thread Richard . Cotton
> Actually (after some trials) there is a little problem when faced with > zeros... > > >getndp(1.0) > [1] 0 Are you sure this isn't what you want? 1.0 is just 1 in disguise, and round(1.0, 0) is the same as round(1.0, 1) anyway. > Note that I thought on a very different way which was starti

Re: [R] Number of digits of a value for problem 7.31 RFAQ SOLVED not really

2008-02-18 Thread Matthieu Stigler
Matthieu Stigler a e'crit : > [EMAIL PROTECTED] a e'crit : What I mean is if R shows 2.3456 I want to obtain the info that >> digits=4 even if in facts the value has more (internal) digits. >>> Try: >>> x = 1.23456789 >>> format(x, nsmall=20) >>> # [1] "1.2345678899989009" >> >> I've