title: rename columns in a list of dataframes
body: <p>I need to be able to rename columns by name in a list of dataframes that can all expected to have the same names.</p>
  
  <p>For example:</p>
  
  <pre><code>[[1]]
    col1 col2
  1    1    2
  2    2    3
  
  [[2]]
    col1 col2
  1    1    2
  2    2    3
  </code></pre>
  
  <p>Should become:</p>
  
  <pre><code>[[1]]
    ID col2
  1    1    2
  2    2    3
  
  [[2]]
    ID col2
  1    1    2
  2    2    3
  </code></pre>
  
  <p>data:</p>
  
  <pre><code>col1 &lt;- c(1,2)
  col2 &lt;- c(2,3)
  myList &lt;- list(data.frame(col1,col2),data.frame(col1,col2))
  </code></pre>
  
  <p>my attempt:</p>
  
  <pre><code>lapply(myList, function(x){
    names(myList[[x]])[names(myList[[x]]) =="col1"] &lt;- "ID"
  })
  </code></pre>
  
  <p>Where did I go wrong? I need base R.</p>