On Fri, 31 Dec 2004, dax42 wrote:

This mailing list truly is amazing.

Thank you so much for all the help!

I feel a little strange asking something that "simple" again, but I wasn't able to find it in the help...

Is there a way to tell R how to display numbers (double)? How many numbers after the decimal point, etc...


Yes. print() has a digits= option, and there are global options that affec the number of digits


Eg:
micropi<-pi*1e-6
nanopi<-pi*1e-9
megapi<-pi*1e6
gigapi<-pi*1e9
options("digits")
$digits
[1] 7
options("scipen")
$scipen
[1] 0
pi
[1] 3.141593
micropi
[1] 3.141593e-06
nanopi
[1] 3.141593e-09
megapi
[1] 3141593
gigapi
[1] 3141592654

options(digits=4) pi
[1] 3.142
micropi
[1] 3.142e-06
nanopi
[1] 3.142e-09
megapi
[1] 3141593
gigapi
[1] 3.142e+09
options(scipen=4)
pi
[1] 3.142
micropi
[1] 0.000003142
nanopi
[1] 3.142e-09
megapi
[1] 3141593
gigapi
[1] 3141592654


-thomas

______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Reply via email to