[R] Writting multiple tables to csv

Gabor Grothendieck ggrothendieck at gmail.com
Fri Jun 19 23:43:08 CEST 2009


Try using append= like this where BOD is built into R:

write.table(BOD[1:3,], "BOD.txt", row.names = FALSE, sep = "\t")
write.table(BOD[4:5,], "BOD.txt", row.names = FALSE, sep = "\t",
col.names = FALSE, append = TRUE)


On Fri, Jun 19, 2009 at 5:20 PM, baked Toast<baked.toast at gmail.com> wrote:
> Hey,
>
> Is it possible to write multiple tables at once to a cvs file? Because
> these tables are of different lengths I can not use cbind. When I use
> following:
>
> Test <- c(capture.output(table(test1),capture.output(table(test2))
> write.table(Test,”test.csv”,row.names=FALSE,sep=”\t”)
>
> I receive messy, unusable csv files.
>
> So my question is, is it possible to use similar tools or other
> functions to write multiple tables to a csv file at once?
>
> Thanks in advance.
>
> Kind regards,
>
> ______________________________________________
> 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.
>




More information about the R-help mailing list