[R] Alternative to aggregate() for averaging

Sebastien Durand sebastien.durand at umontreal.ca
Fri Apr 22 21:43:50 CEST 2005


Hello,

I am working with very large matrices 10000 by 2000

and for each row I have a grouping vector and I 
would like to average each row by groups...

Presently I am using this command and it behaves 
correctly even with NA values is the groupvector:

data<-aggregate(mymatrix,list(groupvector),mean)

Is there a faster method
Thanks!

Sébastien
-- 
  Sébastien Durand
Maîtrise en biologie
Université de Montréal
(514) 343-6864
Université du Québec à Montréal
(514) 987-3000 (1572#)




More information about the R-help mailing list