[R] Bits of scientific notation in write.table() output
Jason Turner
jasont at indigoindustrial.co.nz
Tue Oct 1 11:11:05 CEST 2002
On Fri, Sep 27, 2002 at 01:36:31PM -0500, Steve Wisdom wrote:
>
> What's the preferred method for avoiding `unexpected' bits of scientific
> notation in write.table() output? I've found several inelegant workarounds,
> but I'm sure I'm overlooking an obvious answer
You have to format first, then write. Otherwise, write.table will
format for you, and computers are rarely commended for their taste.
Something like...
write.table(format(df,format=f),file="foo.txt")
read.table("foo.txt")
df
1 95000
2 96000
3 97000
4 98000
5 99000
6 100000
7 101000
8 102000
9 103000
10 104000
11 105000
Jason
--
Indigo Industrial Controls Ltd.
64-21-343-545
jasont at indigoindustrial.co.nz
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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