title: foreach do not work when replacing elements of matrices
body: <p>I'm Mr newbie. I dont understand the reason as to why foreach loops spit out a list of 1 when i run this code, instead of a list of the matrices with the replaced element:</p>
  
  <pre><code>a &lt;- matrix(1:100,nrow=10,ncol=10)
  loop_a &lt;- foreach (i=1:5) %dopar%
  {
  a[a == 6] &lt;- 1  
  }
  </code></pre>