[R] round giving different results on Windows and Mac

Petr Savicky savicky at cs.cas.cz
Sat Mar 10 16:42:41 CET 2012


Hello Ruth:

> Many thanks for this detailed explanation. It seems that the printing is 
> going to vary because it is not done by R. I will try alternative 
> numbers of significant digits: I had set options(digits=4) in an attempt 
> to avoid inter-platform printing differences, without really 
> understanding what was causing them.

If you round the numbers by, say, signif(x, digits=4) before printing
and print with at least 4 digits precision, then the output should not
depend on the printing function, but on signif(), since in this case,
the printing function does not get middle cases.

Function signif() can also have platform dependence, but i think, it
should be rare. Send examples of platform dependencies in signif(), if
you find some.

Petr.



More information about the R-help mailing list