Setting the display precision in R
Sometimes you want to see more digits of a number than R displays by default. There are two posibilities: The command
options(digits=15)
has the effect that from now on, every number printed on the console will be displayed with 15 significant digits. According to the manual you can ask for up to 22 significant digits, but the result is not guaranteed to show 22 significant digits (at least not on my Windows version). An alternative option that is less permanent, is for example
print(pi,digits=17)
For more precision (arbitrary precision in fact) you might want to have a look at the gmp package
1 Comments:
how can I change the default rounding to 5dp?
digits does not keep the 5 deciaml places...
Thanks!
Post a Comment
<< Home