[R] Scientific notation?
Yves Gauvreau
cyg at sympatico.ca
Wed Jan 17 18:38:57 CET 2001
Just what I was looking for.
Many thanks
Yves Gauvreau
B.E.F.P. Universite du Quebec a Montreal
cyg at sympatico.ca
> -----Message d'origine-----
> De : Martin Maechler [mailto:maechler at stat.math.ethz.ch]
> Envoye : Wednesday, January 17, 2001 12:30 PM
> A : Yves Gauvreau
> Cc : R-help at lists. R-project. org
> Objet : Re: [R] Scientific notation?
>
>
> >>>>> "Yves" == Yves Gauvreau <cyg at sympatico.ca> writes:
>
> Yves> Hi, Would there be a function and/or some options to force R to
> Yves> write a value of say 1.0e-4 as "0.0001"? More
> specifically I want
> Yves> to use R to write ASCII file(s) for other programs to read and
> Yves> some of these programs don't know how to deal numbers in
> Yves> scientific notation or have a different convention.
>
> Probably variations of these will solve your problem :
>
> > formatC(pi * 10^(-7:-3), format = "f", digits = 10)
> [1] "0.0000003142" "0.0000031416" "0.0000314159" "0.0003141593"
> "0.0031415927"
>
> > formatC(pi * 10^(-7:-3), format = "fg", digits = 10)
> [1] "0.0000003141592654" "0.000003141592654" "0.00003141592654"
> [4] "0.0003141592654" "0.003141592654"
>
>
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
More information about the R-help
mailing list