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! ------------------------ Philip A. Viton City Planning, Ohio State University 275 West Woodruff Avenue, Columbus OH 43210 viton.1 at osu.edu
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
Hi Philip Try: ?sink. Best, Tal On Mon, Aug 17, 2009 at 5:54 PM, Philip A. Viton <viton.1@osu.edu> 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! > > > ------------------------ > Philip A. Viton > City Planning, Ohio State University > 275 West Woodruff Avenue, Columbus OH 43210 > viton.1@osu.edu > > ______________________________________________ > R-help@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. >-- ---------------------------------------------- My contact information: Tal Galili Phone number: 972-50-3373767 FaceBook: Tal Galili My Blogs: http://www.r-statistics.com/ http://www.talgalili.com http://www.biostatistics.co.il [[alternative HTML version deleted]]
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! > > > ------------------------ > Philip A. Viton > City Planning, Ohio State University > 275 West Woodruff Avenue, Columbus OH 43210 > viton.1 at osu.edu > > ______________________________________________ > 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.Hi, Does: write.table(summary(your_df), "yourfile") give you something you like? What is the reason that you want to write the summary to a file? cheers, Paul -- Drs. Paul Hiemstra Department of Physical Geography Faculty of Geosciences University of Utrecht Heidelberglaan 2 P.O. Box 80.115 3508 TC Utrecht Phone: +3130 274 3113 Mon-Tue Phone: +3130 253 5773 Wed-Fri http://intamap.geo.uu.nl/~paul