correlate | R Documentation |
Matrix of Correlations, P-values and confidence intervals
correlate(
x,
y = NULL,
group = NULL,
method = "pearson",
use = "everything",
adjust = FALSE,
adjust_method = "holm",
engine = "default",
...
)
## S3 method for class 'correlate'
print(x, all = FALSE, ...)
## S3 method for class 'grouped_correlate'
print(x, all = FALSE, ...)
fast_correlate(...)
fast_correlate2(...)
x, y |
a matrix object or NULL. |
group |
NULL or a character vector. |
method |
a character string indicating which correlation coefficient is to be used for the test. One of "pearson", "kendall", or "spearman". |
use |
an optional character string giving a method for computing covariances in the presence of missing values. |
adjust |
logical, if TRUE (default) will adjust p value for multiple comparisons. |
adjust_method |
correction method. |
engine |
one of "default", "WGCNA", "picante", "Hmisc" or "psych", indicating which package is used to calculate the correlation. |
... |
extra params passing to |
all |
if FALSE (default) just print correlation matrix, else will print all values. |
The columns of 'x' will be tested for each pair when y is NULL(the default), otherwise each column in 'x' and each column in 'y' is tested for each pair.
a list with correlation matrix, P values matrix, confidence intervals matrix.
'fast_correlate()' and 'fast_correlate2()' has been deprecated in 0.0.4 version.
Hou Yun
cor
, cor.test
.
correlate(mtcars)
m1 <- matrix(rnorm(100), nrow = 10)
m2 <- matrix(rnorm(60), nrow = 10)
correlate(m1, m2)
## adjust p value
correlate(m1, m2, adjust = TRUE)
## other package engine
## Not run:
## use psych engine
correlate(m1, engine = "psych")
## use Hmisc engine
correlate(m1, engine = "Hmisc")
## use WGCNA engine
correlate(m1, m2, engine = "WGCNA")
## use picante engine
correlate(m1, engine = "picante")
## End(Not run)
m <- correlate(mtcars, cor.test = TRUE)
print(m)
print(m, TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.