title: R - using the assign() function for subsetting an array
body: <p>I have tried to get the gist of my problem in the following reproducible example :</p>
  
  <pre><code>mat &lt;- matrix(3:6,nr=2,nc=2)
  j=1
  &gt; eval(parse(text=paste0("m",c("a","b")[j],"t","[1,1]")))
  [1] 3
  &gt; assign(paste0("m",c("a","b")[j],"t","[1,1]"),45)
  &gt; mat
        [,1] [,2]
  [1,]    3    5
  [2,]    4    6
  </code></pre>
  
  <p>My problem is that <code>mat[1,1]</code> is still equal to <code>3</code> and not <code>45</code> as I would have expected.</p>