title: Change multiple dataframes in a loop
body: <p>I have, for example, this three datasets (in my case, they are many more and with a lot of variables):</p>
  
  <pre><code>data_frame1 &lt;- data.frame(a=c(1,5,3,3,2), b=c(3,6,1,5,5), c=c(4,4,1,9,2))
  data_frame2 &lt;- data.frame(a=c(6,0,9,1,2), b=c(2,7,2,2,1), c=c(8,4,1,9,2))
  data_frame2 &lt;- data.frame(a=c(0,0,1,5,1), b=c(4,1,9,2,3), c=c(2,9,7,1,1))
  </code></pre>
  
  <p>on each data frame I want to add a variable resulting from a transformation of an existing variable on that data frame. I would to do this by a loop. For example:</p>
  
  <pre><code>datasets &lt;- c("data_frame1","data_frame2","data_frame3")
  vars &lt;- c("a","b","c")
  for (i in datasets){
      for (j in vars){
          # here I need a code that create a new variable with transformed values
          # I thought this would work, but it didn't...
          get(i)$new_var &lt;- log(get(i)[,j])
      }
  }
  </code></pre>
  
  <p>Do you have some valid suggestions about that?</p>
  
  <p>Moreover, it would be great for me if it were possible also to assign the new column names (in this case <code>new_var</code>) by a character string, so I could create the new variables by another for loop nested in the other two.</p>
  
  <p>Hope I've not been too tangled in explain my problem.</p>
  
  <p>Thanks in advance.</p>