Skip to content
Back to formatted view

Raw Message

Message-ID: <4D3F7448.5060102@ucalgary.ca>
Date: 2011-01-26T01:09:28Z
From: Peter Ehlers
Subject: write.table -- maintain decimal places
In-Reply-To: <F6E79BFD88B88B46A6B4C26B49D65B68036F3D6C7D@EX-MB06.ohsu.edu>

On 2011-01-25 16:16, Jim Moon wrote:
> Hello, All,
>
> How can I maintain the decimal places when using write.table()?
>
> Jim
>
> e.g.
>
> df:
>    EFFECT2  PVALUE
> 1 0.023    0.88080
> 2 -0.260  0.08641
> 3 -0.114  0.45200
>
> write.table(df,file='df.txt',quote=F,sep='\t',row.names=F)

  write.table(format(df, drop0trailing=FALSE), ....)

Peter Ehlers

>
>
> df.txt:
> EFFECT2    PVALUE
> 0.023      0.8808
> -0.26      0.08641
> -0.114     0.452
>
> 	[[alternative HTML version deleted]]
>
> ______________________________________________
> 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.