[R] aggregation with two statistical functions - mean and variance
Agrarimmobilien
ralf.pfeiffer at agrarimmobilien.info
Mon Dec 24 22:27:46 CET 2007
Hello,
using the syntax
aggregate(daten[,c(3,4)], list(A,B), mean)
I'm getting the following data.frame:
A B C D
1 35 1 6.16000 5
2 47 1 31.24333 20
3 54 1 26.81773 2
4 3 2 12.99000 7
5 4 2 6.49000 1
C and D are both means. But now I want to have: C is mean, D is variance.
How can I do this by using/ changing the aggregation syntax?
Thanks!
Macki
More information about the R-help
mailing list