[R] write a bunch of objects to files

David White dwhite at ling.ohio-state.edu
Tue Oct 30 00:10:45 CET 2001

Hello all,

I've got a bunch of objects I'd like to write to .csv files. For example,
I have objects conveniently called


I tried a loop:

> for(i in ls(pattern="csv"))
+write.table(i, file=i, sep=",", quote=F)

That, of course, wrote out a bunch of files that contained

1, n002.csv

Or the like.

How can I get i in the loop above to be an object instead of a string?


S. David White
sdavidwhite at bigfoot.com
Columbus, Ohio

r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch

More information about the R-help mailing list