title: How to use for loop to save and write files in R
body: <p>I have multiple data frame objects, for instance <code>df1</code>, <code>df2</code> and so on. I want to use a for loop to save and write these files to <code>dta</code>, but I can't figure out where to start. Should I save the data frame objects to a list, and then save them? For instance:</p>
  
  <pre><code>a = list()
  # write for loop saving each data frame objects to a list then
  
  f = c("df1","df2" .. )
  
  end = ".RDA"
  
  for (i in length(a)) {
    for (f in filenames) {
      save(a[[i]],file = paste("~/Panel",filename,end,sep="")
    }
  }
  </code></pre>