Re: [R] Correlation question

2010-09-09 Thread Stephane Vaucher
Hi everyone, Thanks for the help. On Thu, 9 Sep 2010, Peter Ehlers wrote: The first thing to do when you get results that you don't expect is to check the help page. The page for cor clearly states that its input is to a *numeric* vector, matrix or data frame (my emphasis). I would not be happ

Re: [R] Correlation question

2010-09-09 Thread Stephane Vaucher
he quickest way to find out is sessionInfo(). As far as a work around, it would be relative simple to find out which columns of your data frame were not numeric or integer and exclude those (I'm happy to provide that code if you want). Best regards, Josh On Thu, Sep 9, 2010 at 7:50 AM, Step

Re: [R] Correlation question

2010-09-09 Thread Stephane Vaucher
"P7", "HP_tot"), class = "data.frame", row.names = c(NA, -25L)) Correct output is obtained by avoiding matrix computation of correlation: cor(test.number$P3, test.number$HP_tot, method='spearman') [1] -0.2182876 It seems that a text column corrupts

Re: [R] Correlation question

2010-09-08 Thread Stephane Vaucher
3L, 3L, 3L, 3L, 16L, 16L, 16L, 16L, 16L, 16L, 16L), SU_tot = c(19L, 19L, 19L, 19L, 19L, 19L, 19L, 19L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 16L, 16L, 16L, 16L, 16L, 16L, 16L), SR = c(17L, 17L, 17L, 17L, 17L, 17L, 17L, 17L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 17L, 17L, 17L,

[R] Correlation question

2010-09-08 Thread Stephane Vaucher
"LP1.2" [52] "LP1.3""LP1.4""LP_tot" [55] "LO1.1""LO1.2""LO1.3" [58] "LO1.4""LO_tot" "LU1.1" [61]