Description Usage Arguments Details Value Author(s) See Also Examples
correlate
uses cor
to find the correlations and use cor.test
to find
the p values, confidence intervals for all possible pairs of columns ofmatrix.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | correlate(
x,
y = NULL,
cor.test = FALSE,
method = "pearson",
use = "everything",
p.adjust = FALSE,
p.adjust.method = "holm",
...
)
fast_correlate(
x,
y = NULL,
p.adjust = FALSE,
p.adjust.method = "holm",
use = "everything",
...
)
fast_correlate2(
x,
method = "pearson",
p.adjust = FALSE,
p.adjust.method = "holm",
...
)
|
x, y |
a matrix object or NULL. |
cor.test |
logical, if TRUE (default) will test for correlation. |
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. |
p.adjust |
logical, if TRUE (default) will adjust p value for multiple comparisons. |
p.adjust.method |
correction method. |
... |
extra params, see Details. |
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.
Houyun Huang, Lei Zhou, Jian Chen, Taiyun Wei
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | correlate(mtcars)
m1 <- matrix(rnorm(100), nrow = 10)
m2 <- matrix(rnorm(60), nrow = 10)
## not test for correlation matrix
correlate(m1, m2)
## test for correlation matrix
correlate(m1, m2, cor.test = TRUE)
## adjust p value
correlate(m1, m2, cor.test = TRUE, p.adjust = TRUE)
## fast compute correlation
## Not run:
require(WGCNA)
fast_correlate(m1, m2)
require(picante)
fast_correlate2(m1)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.