[R] loop with splitted data

Knut Krueger rh at krueger-family.de
Tue Aug 26 12:37:56 CEST 2008


Hi to all,
seems to be simple, but I do not find the solution:
What must I write for the splitted ???? to get

splitted$"3"$x and  splitted$"3"$x

y = c(rep(2,5),rep(3,5))
ma <- data.frame(x = 1:10, y=y  )
splitted <- split(ma, ma$y)
for (counter in (min(ma$y):max(ma$y)))
{
splitted????$x
}


Regards Knut



More information about the R-help mailing list