title: Loop through and modify list elements
body: <p>I am trying to modify a named element in a list of lists like so:</p>
  
  <pre><code>A &lt;- list(list(a=1,b=1),list(a=2,b=2))
  A[[1]]$a == 1
  </code></pre>
  
  <p>Try to modify the elements:</p>
  
  <pre><code>for(e in A) e$a &lt;- 10
  </code></pre>
  
  <p>Why does this still hold true?</p>
  
  <pre><code>A[[1]]$a == 1
  </code></pre>
  
  <p>And not this:</p>
  
  <pre><code>A[[1]]$a == 10
  </code></pre>
  
  <p>Also, what would be the suggested approach to actually assign <code>10</code> to each <code>.$a</code> element?</p>