title: How to name the columns in a matrice with a loop?
body: <p>I want to name the columns of the matrix: </p>
  
  <pre><code>B=matrix(runif(100), ncol=10,nrow=10,byrow=TRUE)
  </code></pre>
  
  <p>with a simple loop. For example the 10 columns var_1:var_10.
  I found different functions but i am to incompetent to integrate them in each other</p>
  
  <p>Name columns and rows:</p>
  
  <pre><code>dimnames(B)=list(c("VP_1",....,"VP_10"),c("Var_1",...,"Var_10"))
  </code></pre>
  
  <p>and the loop function </p>
  
  <pre><code>for (i in 1:10) {
    e  &lt;- paste("Var_",i,sep="")
    assign(paste("Var_",i,sep=""),with(C,eval(parse(text=e))))
    }
  </code></pre>
  
  <p>may someone help?</p>