cor_tbl: Create a cor_tbl object

Description Usage Arguments Details Value Author(s) Examples

View source: R/cor-tbl.R

Description

Functions to create cor_tbl object from correlation matrix.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
cor_tbl(
  corr,
  p.value = NULL,
  extra.mat = list(),
  type = "full",
  show.diag = TRUE,
  row.names = NULL,
  col.names = NULL,
  row.order = NULL,
  col.order = NULL,
  cluster = "none",
  ...
)

Arguments

corr

correlation matrix.

p.value

significance value matrix of correaltion.

extra.mat

any other matrix-like data with same dimmsion as x.

type

a string, "full" (default), "upper" or "lower", display full, lower triangular or upper triangular matrix.

show.diag

a logical value indicating whether keep the diagonal.

row.names, col.names

row/column names of correlation matrix.

row.order, col.order

row/column order of correlation matrix.

cluster

one of "all", "row", "col" or "none". If is logical value, TRUE value means "all", and FALSE means "none".

...

extra params passing to matrix_order.

Details

Create a cor_tbl object

Value

a cor_tbl object.

Author(s)

Houyun Huang, Lei Zhou, Jian Chen, Taiyun Wei

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
cor_tbl(cor(mtcars))
corr <- correlate(mtcars, cor.test = TRUE)

## with p value
cor_tbl(corr$r, corr$p.value)

## reorder correlation matrix
cor_tbl(corr$r, corr$p.value, cluster = TRUE)

## exclude upper or lower
### exclude lower
cor_tbl(corr$r, corr$p.value, type = "upper")
### exclude upper
cor_tbl(corr$r, corr$p.value, type = "lower", show.diag = FALSE)

## add extra matrix data
m <- matrix(rnorm(11*11), nrow = 11)
cor_tbl(corr$r, corr$p.value, extra.mat = list(m = m))

houyunhuang/ggcor documentation built on July 22, 2020, 8:31 p.m.