[R] cor.test like cor?

2008-05-02 Thread Sang Chul Choi
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)

Re: [R] cor.test like cor?

2008-05-02 Thread Henrique Dallazuanna
Try this: y - data.frame(a=sample(30, 20), b=sample(30, 20), c=sample(30,20)) x - diag(1, length(names(y)) cors - combn(names(y), 2, FUN = function(x)cor.test(y[,x[1]], y[,x[2]])$p.value) x[lower.tri(x)] - cors x[upper.tri(x)] - cors On 5/2/08, Sang Chul Choi [EMAIL PROTECTED]