title: subsetting a list of data frames using a for loop
body: <p>My question is why does the last statement "a &lt;- ..." work to give me a subset of that data frame within the list, but when I try to automate the process with a for loop through all data frames in the list I am met with all kinds of warnings and not the answer I am looking for??  </p>
  
  <pre><code>time &lt;- c(1:20)
  temp &lt;- c(2,3,4,5,6,2,3,4,5,6,2,3,4,5,6,2,3,4,5,6)
  data &lt;- data.frame(time,temp)
  
  tmp &lt;- c(1,diff(data[[2]]))
  tmp2 &lt;- tmp &lt; 0
  tmp3 &lt;- cumsum(tmp2)
  data1 &lt;- split(data, tmp3)
  
  #this does not work.  I want to automate the successful process below through all data frames in the list "data1"
  for(i in 1:length(data1)){
     finale[i] &lt;- subset(data1[[i]], data1[[i]][,2] &gt; 3)
  }
  
  #this works to give me a part of what I want
  a &lt;- subset(data1[[1]], data1[[1]][,2] &gt;3)
  </code></pre>