Fast Pearson/Spearman correlation where y is vector, x is matrix, adapted
from stats::cor.test.
correls2(y, x, method = "pearson", use = "complete.obs")Matrix with columns containing the correlation statistic, either
Pearson r or Spearman rho, and p-values for each column of x correlated
against vector y
Numerical vector
Matrix
Type of correlation, either "pearson" or "spearman".
Optional character string giving a method for computing covariances in the presence of missing values. See cor
For speed, p-values for Spearman's test are computed by
asymptotic t approximation, equivalent to cor.test with exact = FALSE.