title: R loop over multiple matrices
body: <p>I have 472 matrices with 405 columns each (matrix1 , ... , matrix400) and want to have 472 new matrices with only the first 244 columns of that matrix. How can I do that? I tried: </p>
  
  <pre><code>for (i in 1:472) {
  assign(paste("new_matrix",i,sep=""), matrix[[i]][,c(1:244)])
  }
  </code></pre>
  
  <p>I created the matrices by splitting one dataframe by one identifier (for the groups): </p>
  
  <pre><code>for (i in 1:472){
     assign(paste("matrix", i, sep=""), subset(data, ID==i))
  }
  </code></pre>
  
  <p>Somehow I cannot speak to each matrix but I have no clue how I can do that.</p>