title: How do I use a variable to name another variable in R?
body: <p>I have a function that uses <code>readline</code> to allow the user to enter the name they want to give for a variable I will be creating for them.  Let's call this "USER.DEFINED.VARIABLE".  It contains the name I want to use for another variable.  Let's say that "USER.DEFINED.VARIABLE" gets set by <code>readline</code> to be "jimsfilename".</p>
  
  <p>I know I can assign value to a variable named "jimsfilename" using:</p>
  
  <pre><code>assign(USER.DEFINED.VARIABLE,c(1,2,3,4,5))
  </code></pre>
  
  <p>"jimsfilename" will now have <code>1,2,3,4,5</code> in it.  However, how do I now fuss with "jimsfilename", given that I don't (before readline assigns it to USER.DEFINED.VARIABLE) know what its name is?</p>
  
  <p>In other words, lets say I now want to add 1 to every value in jimsfilename. I can't do:</p>
  
  <pre><code>USER.DEFINED.VARIABLE &lt;- USER.DEFINED.VARIABLE + 1 # can't do this
  </code></pre>
  
  <p>because "USER.DEFINED.VARIABLE" is actually a text string name.  I want instead to refer to jimsfilename, but all I have is USER.DEFINED.VARIABLE to indicate it.  I'm sure this is something easy...</p>