title: Why doesn't assign() values to a list element work in R?
body: <p>I'm trying to use assign values in an object in a list.  What I want to do is change some elements.  For example:</p>
  
  <pre><code>x &lt;- list()
  x$test &lt;- 1
  assign("x$test", 2)
  x$test == 1
       [1] TRUE
  </code></pre>
  
  <p>Any thoughts?  I need to use assign because I am building a function which will take the names of the objects within the list (x) as inputs.</p>