[R] kunamorph@web.de

From: Christfried Kunath <kunamorph_at_web.de>
Date: Sat 09 Apr 2005 - 01:39:30 EST


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(), because I have many groups.

Thanks in advance.
Christfried Kunath KC



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Sat Apr 09 01:43:24 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:31:05 EST