Skip to content
Prev 311057 / 398506 Next

Calculateing means

?aggregate will do it.

x <- data.frame( height= c(50, 174, 145, 200, 210, 140, 175), age_group=c(1,2,2,1,1,2,1), 
                     ville= c(1,2,3,1,2,3,1))

aggregate(x$height,list(x$age_group, x$ville), mean)

or have a look at the plyr or datatable packages.

John Kane
Kingston ON Canada
____________________________________________________________
Send any screenshot to your friends in seconds...
Works in all emails, instant messengers, blogs, forums and social networks.
TRY IM TOOLPACK at http://www.imtoolpack.com/default.aspx?rc=if2 for FREE