[R] simple usage of "for"

Hans Ekbrand hans at sociologi.cjb.net
Tue Feb 19 16:03:48 CET 2008


On Tue, Feb 19, 2008 at 04:52:19PM +0200, K. Elo wrote:
> 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]])) }

It works, thanks!

--
Hans Ekbrand
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : https://stat.ethz.ch/pipermail/r-help/attachments/20080219/11f48ad5/attachment.bin 


More information about the R-help mailing list