Michael Just
2008-Oct-09 21:54 UTC
[R] Write multiple objects / data frames into a single .csv -- write.csv
Hello, Is there a way to put multiple data.frames or objects into a single .csv ? I know I can use sink() to do this for a text file. Is there way to do it for a .csv? e.g. for sink() sink("c5.k.s.p.92.LN.sl.vs.mean.txt") symnum(c5.k.92.LN.sl.vs.mean) symnum(c5.s.92.LN.sl.vs.mean) symnum(c5.p.92.LN.sl.vs.mean) sink() Could I put these all into a single .csv, in a similar format to sink()? Thanks, Michael Just [[alternative HTML version deleted]]
Yihui Xie
2008-Oct-10 05:47 UTC
[R] Write multiple objects / data frames into a single .csv -- write.csv
use "append = TRUE" or rbind() your data.frames together before writing the csv file. Regards, Yihui -- Yihui Xie <xieyihui at gmail.com> Phone: +86-(0)10-82509086 Fax: +86-(0)10-82509086 Mobile: +86-15810805877 Homepage: http://www.yihui.name School of Statistics, Room 1037, Mingde Main Building, Renmin University of China, Beijing, 100872, China On Fri, Oct 10, 2008 at 5:54 AM, Michael Just <mgjust at gmail.com> wrote:> Hello, > Is there a way to put multiple data.frames or objects into a single .csv ? > I know I can use sink() to do this for a text file. Is there way to do it > for a .csv? > > e.g. for sink() > > sink("c5.k.s.p.92.LN.sl.vs.mean.txt") > symnum(c5.k.92.LN.sl.vs.mean) > symnum(c5.s.92.LN.sl.vs.mean) > symnum(c5.p.92.LN.sl.vs.mean) > sink() > > Could I put these all into a single .csv, in a similar format to sink()? > > Thanks, > Michael Just > > [[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. >