[R] printing a dataframe summary to disk

Steve Lianoglou mailinglist.honeypot at gmail.com
Tue Aug 18 16:36:18 CEST 2009


Hi,

On Aug 17, 2009, at 10:54 AM, Philip A. Viton wrote:

> I'd like to write the summary of a dataframe to disk, so that it looks
> essentially the same as what you'd see on screen; but I can't seem  
> to do it. Can someone tell me how? Thanks!

Look at: ?write.table and friends

You can write the data.frame that way. If you're looking to serialize  
the result of a call to summary(my.data.frame) to a disk, just note  
that the summary function returns the summary as  table (and doesn't  
simply print it to the terminal), so:

my.summary <- summary(some.data.frame)
write.table(my.summary, quote=FALSE, file="summary.txt")

-steve

--
Steve Lianoglou
Graduate Student: Computational Systems Biology
   |  Memorial Sloan-Kettering Cancer Center
   |  Weill Medical College of Cornell University
Contact Info: http://cbio.mskcc.org/~lianos/contact




More information about the R-help mailing list