title: R get() function error
body: <p>I'm trying to populate a set of
  matrices  where the matrix (object) names are held in a list. I can
  use the get() to return the object with the given name, but I'm
  running into function problems when I use get() to define the matrix
  object I'm trying to populate.</p>
  
  <pre><code>#Create list of matrix names:
  list.names &lt;- c("m.1")
  
  #Create matrix object
  m.1 &lt;- matrix(nrow=2,ncol=2)
  
  #Return matrix m.1 from the list.names using get(). Works great!
  get(list.names[1])
  
  #Populate m.1 with some values. Doesn't work.
  get(list.names[1]) &lt;- c(1,2,3,4)
  </code></pre>
  
  <p>So in the last line of code, I'm getting an error:</p>
  
  <p>could not find function "get&lt;-"</p>
  
  <p>Similarly, I can call m.1 using:</p>
  
  <pre><code>eval(as.name(list.name[1]))
  </code></pre>
  
  <p>But R returns a similar 'could not find function' error when I try to populate the matrix.</p>
  
  <p>Could someone explain the error in my approach, here?</p>
  
  <p><strong>Edit/Update:</strong> </p>
  
  <p>So in my attempt to simplify the question for posting here, I realized that I may have oversimplified what I'm attempting to do. </p>
  
  <p>So, in fact, I'm attempting to populate elements within a set of matricies. The names of the matrices are contained in the list.names object. I'm using nested for() loops to populate each element within the matrices. </p>
  
  <p>So, in fact, my problem would be more accurately stated as:</p>
  
  <pre><code>get(list.names[1])[1,1] &lt;- some_value
  </code></pre>
  
  <p>A couple of the replies have suggested that I use assign based upon my original post, but given that I'm attemping to 'assign' an element within the object rather than the whole object , this approach won't work. </p>
  
  <p>Sorry for the confusion.</p>