[R] simple usage of "for"

K. Elo maillists at nic.fi
Tue Feb 19 15:52:19 CET 2008


Hi,

Hans Ekbrand wrote (19.2.2008):
> I tried the following small code snippet which I copied from the
>
> "Introduction to R":
> > for (i in 2:length(meriter)) { table(meriter[[1]], meriter[[i]]) }

Try:
for (i in 2:length(meriter)) { print(table(meriter[[1]], 
meriter[[i]])) }

Kind regards,
Kimmo



More information about the R-help mailing list