Skip to content
Prev 304478 / 398502 Next

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

Try by()

#Example
d <- data.frame(g=gl(5, 10), x=rnorm(50), y=rnorm(50))
by(d[,2:3], d$g, cor, method="spearman")
 

*******************************************************************
This email and any attachments are confidential. Any use...{{dropped:8}}