title: Renaming a data frame using the value of a string
body: <p>Is there a way to rename a data frame using the value of a string?</p>
  
  <p>I'm trying to write a function in [R] that takes a vector of values, operates over them, and (among other things) returns a data frame to the global environment using the &lt;&lt;- operator. I'd like the name of this data frame to reflect the name of the vector used to create it.</p>
  
  <p>Ideally the code would look something like this:</p>
  
  <pre><code>my.func &lt;- function(vector.in){
  
  # ... Operations over vector.in ... #
  
  data.out &lt;- data.frame(x1 = ...)
  new.name &lt;- paste("data.out", deparse(substitute(vector.in)), sep="_")
  
  #Change the name of data.out to the value of the string new.name
  changename(data.out, new.name)
  
  #Export the newly named object to the global environment
  new.name &lt;&lt;- new.name
  
  # ... More operations ... #
  
  }
  </code></pre>