I want to batch export data frames in my workspace having the string “obj” in their names to a csv file with the same name
I thought of the following code, which unfortunately does not work.
for (i in ls(pattern="obj")){
write.csv2(i, paste(i,".csv", sep=""))
}
Any ideas? Thank you in advance
write.csv2takes the object rather than the name of the object as its first argument. Usegetto remedy this.