correlation by group (was Re: [R] kunamorph@web.de)

2005-04-08 Thread Sundar Dorai-Raj
Christfried Kunath wrote on 4/8/2005 10:39 AM: Hello, how can I use the function "cor()" with x and y in function "aggregate()" or "by()"? The data are like this: x y group 1 4 B 2 4 B 3 5 C I would like obtain the correlation between x and y for each subset. I don't want to use

[R] kunamorph@web.de

2005-04-08 Thread Christfried Kunath
Hello, how can I use the function "cor()" with x and y in function "aggregate()" or "by()"? The data are like this: x y group 1 4 B 2 4 B 3 5 C I would like obtain the correlation between x and y for each subset. I don't want to use the workaround with the function subset(), beca