title: Dynamic column name in for loop with cbind
body: <p>I'm trying a loop like this, where I want to assign the name of the matrix column dynamically:</p>
  
  <pre><code>for(i in 1:nclass){
    P &lt;- eXb / SeXb[mydata$chid]
    mydata &lt;- cbind(mydata, paste("l_", i, sep="")=P)
  }
  </code></pre>
  
  <p>Any idea (apart from changing colnames ex-post)?</p>
  
  <p>Thanks</p>