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

2012-01-18 Thread RNoob
Great! Thanks. -- View this message in context: http://r.789695.n4.nabble.com/Using-Aggregate-with-FUN-arguments-which-require-more-than-one-input-variables-tp4303936p4306170.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-pr

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

2012-01-18 Thread Uwe Ligges
lting vector will be length(unique(groups)). I think this draws a clearer picture to you. Sorry for not precisely pointing it out in my first post. Thanks and Regards! sapply(split(numbers, groups), function(x) cor(x[,1], x[,2])) Uwe Ligges -Ursprüngliche Nachricht- Von: Uwe

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

2012-01-18 Thread Alexander Erbse
will be length(unique(groups)). I think this draws a clearer picture to you. Sorry for not precisely pointing it out in my first post. Thanks and Regards! -Ursprüngliche Nachricht- Von: Uwe Ligges [mailto:lig...@statistik.tu-dortmund.de] Gesendet: Dienstag, 17. Januar 2012 19:21 An: Alexan

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

2012-01-18 Thread RNoob
as.matrix() will not help here. I will get the same error message. And also, I don't need correlation matrices. I simply need a vector of correlations. I will show you some code and data I am using. Here you can see my main dataframe: > head(test) industry datetestvar ret

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

2012-01-17 Thread Rui Barradas
Hello, RNoob wrote > > 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 callin

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

2012-01-17 Thread Uwe Ligges
On 17.01.2012 18:10, RNoob wrote: 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

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

2012-01-17 Thread RNoob
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