Open Gael-Hammer opened 1 week ago
cor.mtest is basically a loop calling cor.test(x = mat[, i], y = mat[, j], ...) When combinations of x and y do not have enough data, cor.test fails and thus cor.mtest. Please catch this error, maybe with something along these lines:
cor.mtest
cor.test(x = mat[, i], y = mat[, j], ...)
if(sum(!is.na(mat[,i]*mat[,j])) > 2) { tmp = cor.test(x = mat[, i], y = mat[, j], ...) } else { tmp <- list(p.value = NA, conf.int = NULL) }
cor.mtest
is basically a loop callingcor.test(x = mat[, i], y = mat[, j], ...)
When combinations of x and y do not have enough data, cor.test fails and thus cor.mtest. Please catch this error, maybe with something along these lines: