Re: [R] disabling scientific number format

From: Uwe Ligges <ligges_at_statistik.tu-dortmund.de>
Date: Wed, 16 Jun 2010 13:58:44 +0200

On 16.06.2010 08:59, David Croll wrote:
>
>
> 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?

See argument "scipen" in ?options.

Uwe Ligges

>
>
>
> 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.



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 - 12:01:07 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:20: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