title: Save values from FOR loop for further analysis
body: <p>How do I save the values from the For Loop from the following code? When I pint the variable "lm5", it has a total of two values. When I tried to save it to a new variable, it only shows the last value. </p>
  
  <p>Ideally, I would like to save the lm5,lm10,lm20 for another round of IF statement analysis. Could you please advise how to proceed? Thanks in advance!</p>
  
  <pre><code>even&lt;-c(2,4)
  
  for( i in even){
    m5&lt;-rollmean(test[,i],5,fill=NA)
    m10&lt;-rollmean(test[,i],10,fill=NA)
    m20&lt;-rollmean(test[,i],20,fill=NA)
    lm5&lt;-tail(m5[!is.na(m5)],1)
    print(lm5)
  }
  </code></pre>