Dear Colleagues,
does anybody know how to aggregate a data.frame using different functions for
different columns?
Sincerely
___
Markus Preisetanz
Consultant
Client Vela GmbH
Albert-Roßhaupter-Str. 32
81369 München
fon: +49 (0) 89 742 17-113
fax:
you can use mapply()...
z <- as.data.frame(matrix(1:3,3,3,T))
mapply(function(x,y) x(y), c(sum,prod,sum), z)
Markus Preisetanz a écrit :
>Dear Colleagues,
>
>
>
>does anybody know how to aggregate a data.frame using different functions for
>different columns?
>
>
>
>Sincerely
>
>
>
>__
Hi
have you tried
>?aggregate
eg > df1<-aggregate(mydata, list(mean1=x1,mean2=x2),mean)
-
[[alternative HTML version deleted]]
__
R-help@stat.math.ethz.ch mailing list
https://st