runner wrote: > In the documentation of 'pairs'(package:graphics), within the last example, > it reads: > > format(c(r, 0.123456789), digits=3)[1] > > Why not simple use: format(r, digits=3)? What is the difference?
Here are some examples of the difference: > for (r in 1.2*10^(-6:9)) cat(format(c(r, 0.123456789), digits=3)[1], format(r, digits=3), "\n") 1.20e-06 1.2e-06 0.000012 1.2e-05 0.00012 0.00012 0.0012 0.0012 0.012 0.012 0.120 0.12 1.200 1.2 12.000 12 120.000 120 1200.000 1200 1.20e+04 12000 1.20e+05 120000 1.20e+06 1200000 1.20e+07 1.2e+07 1.20e+08 1.2e+08 1.20e+09 1.2e+09 > > > Thanks. ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.