title: How to save() with a particular variable name
body: <p>I am repeatedly applying a function to read and process a bunch of csv files. Each time it runs, the function creates a data frame (<code>this.csv.data</code>) and uses save() to write it to a <code>.RData</code> file with a unique name. Problem is, later when I read these <code>.RData</code> files using <code>load()</code>, the loaded variable names are not unique, because each one loads with the name <code>this.csv.data</code>.... </p>
  
  <p>I'd like to save them with unique tags so that they come out properly named when I <code>load()</code> them. I've created the following code to illustrate .</p>
  
  <pre><code>this.csv.data = list(data=c(1:9), unique_tag = "some_unique_tag")
  assign(this.csv.data$unique_tag,this.csv.data$data)
  # I want to save the data, 
  # with variable name of &lt;unique_tag&gt;, 
  # at a file named &lt;unique_tag&gt;.dat
  saved_file_name &lt;- paste(this.csv.data$unique_tag,"RData",sep=".")
  save(get(this.csv.data$unique_tag), saved_file_name)
  </code></pre>
  
  <p>but the last line returns:</p>
  
  <blockquote>
  <pre><code>"Error in save(get(this_unique_tag), file = data_tag) : 
    object ‘get(this_unique_tag)’ not found"
  </code></pre>
  </blockquote>
  
  <p>even though the following returns the data just fine:</p>
  
  <pre><code>get(this.csv.data$unique_tag)
  </code></pre>