correls2 | R Documentation |
Fast Pearson/Spearman correlation where y
is vector, x
is matrix, adapted
from stats::cor.test.
correls2(y, x, method = "pearson", use = "complete.obs")
y |
Numerical vector |
x |
Matrix |
method |
Type of correlation, either "pearson" or "spearman". |
use |
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
.
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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.