Skip to content
Prev 304504 / 398502 Next

Help on calculating spearman rank correlation for a data frame with conditions

On 2012-08-29 08:45, S Ellison wrote:
It may seem a bit of overkill, but the plyr package is handy and
gives a nice output:

   library(plyr)
   ddply(d, .(g), summarize, correlation = cor(x, y, method = 's'))

Peter Ehlers