Please use the 'Add reply' button to reply to a comment. This keeps the discussion organized. Also, don't create an answer to provide information as this gives the impression the question has already been answered. What are those +1 columns ? Are they numeric ?
hi all, when I want to calculate correlation by rcorr,the number of non coding is 23 and the number of coding is 634,R shows this warning message,what should I do?
res2=rcorr(coding,ncoding,type = "spearman")
Warning message:
In sqrt(npair - 2) : NaNs produced
I think because of Inequality of number of coding & noncoding there is this warning and for that reason I have NA at the end of correlation matrix,is it true?
1 answer
Hi Jean,
dim(coding)
[1] 23 635
dim(ncoding)
[1] 23 24
23 is the number of samples ,24 and 635 is the number of coding and ncoding{23 noncoding+1 column that related to myfactor(the name of samples ) & 634coding+1 column that related to myfactor} ,what is the problem?
you have a right,it is not Intentional.
no, the column was the name of sample,actually I removed that column by this function t4 <- t3[,-11] and now there is no that error.
Log in to answer this question.
When npair <2, R can't calculate the square root. This is likely caused by your input not being of adequate dimensions. Check dim(coding) and dim(ncoding).