[R] disabling scientific number format

From: David Croll <david.croll_at_gmx.ch>
Date: Wed, 16 Jun 2010 08:59:32 +0200

Hello R users,

I am a bit puzzled by the fact that

options(digits=22)

x0 <- 69880
y0 <- 26185
x1 <- 69600
y1 <- 22937

number <- paste(x0,y0,x1,y1,sep="")

number <- as.numeric(travel)

print(number)

gives number in scientific notation (some precision is wasted by having a "e+19" at the tail):

6.988026185696e+19

but

print(exp(log(number)))

gives the full 20 digits of number (albeit with a certain error due to the log() and exp() transformation):

69880261856959807488

How can I set print(number) to the normal notation instead of the scientific one, or at least improve the precision of the scientific notation?

Kind regards,

David



R-help_at_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. Received on Wed 16 Jun 2010 - 07:02:39 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 16 Jun 2010 - 12:10:31 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive