title: apply list of indices to list of dataframes
body: <p>I need to apply a list of indices to a list of dataframes with a one on one mapping. First element of the list of indices goes to the first dataframe only and so on. List of indices applies to the rows in the dataframes. 
  And a list of complementary dataframes needs to created by selecting rows not mentioned in the indices list.</p>
  
  <p>Here is some sample data:</p>
  
  <pre><code>set.seed(1)
  A &lt;- data.frame(matrix(rnorm(40,0,1), nrow = 10))
  B &lt;- data.frame(matrix(rnorm(40,2,3), nrow = 10))
  C &lt;- data.frame(matrix(rnorm(40,3,4), nrow = 10))
  
  dflis &lt;- list(A,B,C)
  
  # Create a sample row index
  ix &lt;- lapply(lapply(dflis,nrow), sample, size = 6)
  </code></pre>
  
  <p>So far I have managed this working but ugly looking code:</p>
  
  <pre><code>dflis.train &lt;- lapply(seq_along(dflis), function(x) dflis[[x]][ix[[x]],])
  
  dflis.test &lt;- lapply(seq_along(dflis), function(x) dflis[[x]][-ix[[x]],])
  </code></pre>
  
  <p>Can someone suggest something better, more elegant?</p>