title: Apply subset function to a list of dataframes
body: <p>I have a list of <code>SpatialPolygonDataFrame</code> that I can assimilate to <code>dataframe</code> like this:</p>
  
  <pre><code>df.1 &lt;- data.frame(A = c(1:10), B = c(1, 2, 2, 2, 5:10))
  df.2 &lt;- data.frame(A = c(1:10), B = c(1, 2, 2, 2, 2, 2, 7:10))
  df.3 &lt;- data.frame(A = c(1:10), B = c(1, 2, 2, 4:10))
  
  list.df &lt;- list(df.1, df.2, df.3)
  </code></pre>
  
  <p>I would like to get a list of a subset of each dataframe based on condition (<code>list.df.sub</code> is the result I am looking for):</p>
  
  <pre><code>df.1.sub &lt;- subset(df.1, df.1$B != 2)
  df.2.sub &lt;- subset(df.2, df.2$B != 2)
  df.3.sub &lt;- subset(df.3, df.3$B != 2)
  
  list.df.sub &lt;- list(df.1.sub, df.2.sub, df.3.sub)
  </code></pre>
  
  <p>I would like to apply directly my subset on <code>list.df</code>. I know that I have to use <code>lapply</code> function but don't know how?</p>