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