I am trying to export all data sets in R environment into separate csv files using the code below.
For some reason, the exported datasets are empty.
files <- ls()
pattern <- ".csv"
for (i in 1:length(files)) {
write.csv(files[i], paste(files[i], pattern, sep = ""))
}