correlate: Correlate

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/correlate.R

Description

Matrix of Correlations, P-values and confidence intervals

Usage

 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
correlate(
  x,
  y = NULL,
  method = "pearson",
  use = "everything",
  adjust = FALSE,
  adjust_method = "holm",
  ...
)

fast_correlate(
  x,
  y = NULL,
  adjust = FALSE,
  adjust_method = "holm",
  use = "everything",
  ...
)

fast_correlate2(
  x,
  method = "pearson",
  adjust = FALSE,
  adjust_method = "holm",
  ...
)

Arguments

x, y

a matrix object or NULL.

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.

...

extra params, see Details.

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.

Value

a list with correlation matrix, P values matrix, confidence intervals matrix.

Author(s)

Hou Yun

See Also

cor, cor.test.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
correlate(mtcars)

m1 <- matrix(rnorm(100), nrow = 10)
m2 <- matrix(rnorm(60), nrow = 10)
correlate(m1, m2)

## adjust p value
correlate(m1, m2, cor.test = TRUE, adjust = TRUE)

## fast compute correlation
## Not run: 
require(WGCNA)
fast_correlate(m1, m2)

require(picante)
  fast_correlate2(m1)

## End(Not run)

Hy4m/hyplot documentation built on March 29, 2021, 6:19 p.m.