[R] cor.test like cor?

Sang Chul Choi choi at biology.rutgers.edu
Fri May 2 21:50:31 CEST 2008


Hi,

Is there a simple way to do correlation coefficient tests with  
"cor.test" like I would do with "cor" function? I have a data frame  
where each column is a list.

================================================
y <- data.frame(a=sample(30, 20), b=sample(30, 20), c=sample(30,20))
cor(y)
================================================

But, cor.test does not take y alone, and it needs two vectors. We may  
do each test by iterating a pair of columns by loop. Is there a simple  
way to do it? I will appreciate your help.

Thank you,

Sang Chul



More information about the R-help mailing list