Hello,
I am attempting to run a collinearity test on detection data I have, through spearman rank and pearson tests. However, I have run into a problem I was hoping someone may be able to help me past (I am still fairly new to RStudio).
I successfully entered and read my detection data in R (all detection data have replicates of 5) and created a list of them using the list() function.
However, when I try to turn it into a matrix using the following code:
obs.det.n<-as.matrix(sapply(obs.det, as.numeric,2),nrow=50,ncol=5,byrow=TRUE)
I get the error "Error in lapply(X = X, FUN = FUN, ...) :
'list' object cannot be coerced to type 'double'".
Does anyone have any idea of what is going wrong and how to circumvent the issue?
Here is the data.frame(obs.det) for partial data in case that helps.
dh.R1.dh dh.R2.dh dh.R3.dh dh.R4.dh dh.R5.dh
1 0.2041685 0.3336424 0.2950844 0.2527576 0.5325092
2 0.2041685 0.3336424 0.2950844 0.2527576 0.5325092
3 0.2041685 0.3336424 0.2950844 0.2527576 -1.8395773
4 0.2041685 0.3336424 0.2950844 0.2527576 0.5325092
5 -4.7979587 0.3336424 0.2950844 0.2527576 -1.8395773
6 0.2041685 0.3336424 0.2950844 0.2527576 0.5325092
7 0.2041685 0.3336424 0.2950844 0.2527576 0.5325092
9 0.2041685 0.3336424 0.2950844 0.2527576 -1.8395773
10 0.2041685 0.3336424 0.2950844 0.2527576 0.5325092
11 0.2041685 -2.9360532 0.2950844 0.2527576 0.5325092
12 0.2041685 0.3336424 0.2950844 0.2527576 0.5325092