[R] number format, writing 1e-5 instead of 0.00001

David Winsemius dwinsemius at comcast.net
Wed Oct 20 16:05:17 CEST 2010


On Oct 20, 2010, at 9:21 AM, skan wrote:

>
> Hello
>
> I've used read.table to read a file that contains numbers such as    
> 0.00001
>
> when I write them back with write.table those numbers appear as  1e-5
>
> How can I keep the old format?

To change globally for the session:
?options
 > options("scipen" = 3)
 >
 > 0.00001
[1] 0.00001
 > 0.0000001
[1] 1e-07
 > 0.000001
[1] 0.000001

Other options for output:

?format
?sprintf

-- 
David Winsemius, MD
West Hartford, CT



More information about the R-help mailing list