write.table

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

write.table

fluss
Hello!
When using the command "write.table" I want to convert the format: 5e-04
to  .0005. How can I do it?
The only option I found is to use write.matrix but then I cant add rownames.
Thank you
Ronen

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Reply | Threaded
Open this post in threaded view
|

Re: write.table

Sundar Dorai-Raj
See the "scipen" argument in ?options.

write.table(data.frame(x = 0.0005))
options(scipen = 1)
write.table(data.frame(x = 0.0005))

--sundar

fluss wrote:

> Hello!
> When using the command "write.table" I want to convert the format: 5e-04
> to  .0005. How can I do it?
> The only option I found is to use write.matrix but then I cant add rownames.
> Thank you
> Ronen
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Reply | Threaded
Open this post in threaded view
|

Re: write.table

Brian Ripley
In reply to this post by fluss
> Hello!
> When using the command "write.table" I want to convert the format: 5e-04
> to  .0005. How can I do it?
> The only option I found is to use write.matrix but then I cant add rownames.
> Thank you
> Ronen

?options, see scipen.

Or, use format() to convert table before writing it.

--
Brian D. Ripley,                  [hidden email]
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html