title: Affecting variable through eval or similar
body: <p>I know that if i have the name of a variable stored like <code>a = &quot;var.name&quot;</code>, i can call this <code>var.name</code> by doing <code>eval(as.symbol(a))</code> or <code>get(a)</code>, but i wanted to not only call a variable, but also make changes to it. Example:</p>
  <pre><code>names = c(&quot;X1&quot;,&quot;X2&quot;)
  for(i in names){
      assign(i, cbind(replicate(2,rnorm(3))) #Just creating a 3x2 matrix with dummy data
      ###
  </code></pre>
  <p>At ### i'd like to make a change to the variables, specifically change its column names to &quot;a&quot; and &quot;b&quot;.</p>
  <p>I tried <code>colnames(get(i)) = c(&quot;a&quot;,&quot;b&quot;)</code>, or <code>colnames(eval(as.symbol(i))) = c(&quot;a&quot;,&quot;b&quot;)</code>, but they return errors like <code>could not find function &quot;eval&lt;-&quot;</code></p>