[R] For loop for subset - repeating same over and over?

kelseyann kremerke at mail.gvsu.edu
Fri Sep 30 01:37:00 CEST 2011

Hello, I am using the following script to run an anova for numerous species
in a table that I have:

SiteSpp <-

n.SiteSpp <- length(SiteSpp)

  for (i in (1:n.SiteSpp)) {
      QInfl.aov <- aov(AvgOfnumResponse ~ strTrea*strYear,
data=QInflAvgbyPlot, subset=(SiteSpp == SiteSpp[i]))

The resulting summary just continuously prints the same anova results (For
ADHALP) over and over again.... Any suggestions?


View this message in context: http://r.789695.n4.nabble.com/For-loop-for-subset-repeating-same-over-and-over-tp3858115p3858115.html
Sent from the R help mailing list archive at Nabble.com.

More information about the R-help mailing list