Skip to content
Prev 175616 / 398503 Next

Using apply to get group means

Not exactly the output you asked for, but perhaps you can consider,

library(doBy)
 > summaryBy(x3~x2+x1,data=x,FUN=mean)
the plyr package also provides similar functionality, as do the ?by, ? 
ave, and ?tapply base functions.

HTH,

baptiste
On 31 Mar 2009, at 17:09, Alan Cohen wrote:

            
_____________________________

Baptiste Augui?

School of Physics
University of Exeter
Stocker Road,
Exeter, Devon,
EX4 4QL, UK

Phone: +44 1392 264187

http://newton.ex.ac.uk/research/emag