title: How to index (subset) over a list of data.frames
body: <p>I got a list of several data.frames and I want to remove the first 2 columns from each of the data.frames. I did it as follows, but feel this could be more R-ish. </p>
  
  <pre><code>data(mtcars)
  data(iris)
  myList &lt;- list(A = mtcars, B = iris)
  # helper function
  removeCols &lt;- function(df,vec) {
  res &lt;- df[,-vec]
  }
  lapply(myList,removeCols,1:2)
  </code></pre>
  
  <p>Obviously this does the job, but to me it seems like i must have missed something here (such as using an operator within lapply, cause it's technically a function too). 
  However, the major disadvantage of this approach is that you need a little helper function for every little task you want to do to all elements of that list. </p>