[R] Using Aggregate() with FUN arguments, which require more than one input variables

RNoob ae at alpha-centauri.com
Tue Jan 17 18:10:00 CET 2012


Dear all,

I am trying to apply the aggregate() function to calculate correlations for
subsets of a dataframe. My argument x is supposed to consist of 2 numerical
vectors, which represent x and y for the cor() function. 

The following error results when calling the aggregate function: Error in
FUN(X[[1L]], ...) : supply both 'x' and 'y' or a matrix-like 'x'. I think
the subsets aggregate puts into cor() are sort of list types and therefore
can't be handled by cor().

Can anyone provide me with a solution?

Regards,
RNoob

--
View this message in context: http://r.789695.n4.nabble.com/Using-Aggregate-with-FUN-arguments-which-require-more-than-one-input-variables-tp4303936p4303936.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list