title: create new columns recursively in a list
body: <p>I have the following vector:</p>
  
  <pre><code>x&lt;-c("x1","x2")
  </code></pre>
  
  <p>Suppose I have the following list with two dataframes:</p>
  
  <p>list(df1,df2) </p>
  
  <p>where <code>df1</code> and <code>df2</code> are two different dataframes</p>
  
  <p>what I want to do is to create a new column in each of these dafarames within this list that takes recursively the values of vector <code>x</code> </p>
  
  <pre><code>OLD list &lt;- list(df1,df2) 
  </code></pre>
  
  <p>After manual manipulations:</p>
  
  <pre><code>df1$var&lt;- x[1]
  df2$var&lt;- x[2]
  </code></pre>
  
  <p>so my new list </p>
  
  <pre><code>Newlist&lt;-list(df1,df2)
  </code></pre>
  
  <p>This is what I tried:</p>
  
  <pre><code>for (i in 1:length(x)) {
    old.list[[i]]$var&lt;-x[i]
  }
  
  new.list&lt;-old.list
  </code></pre>
  
  <p>But, is there any efficient code considering that my <code>x</code> vector is very large in my case. </p>