corrplot_mixed: Customized corrplot

Description Usage Arguments Value Examples

View source: R/mod_cs_cor_corrplot.R

Description

Customized corrplot

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
corrplot_mixed(
  cor_matrix,
  cor_test = NULL,
  lower = "number",
  upper = "circle",
  lower.col = NULL,
  upper.col = NULL,
  order = c("original", "AOE", "FPC", "hclust", "alphabet"),
  hclust.method = c("complete", "ward", "ward.D", "ward.D2", "single", "average",
    "mcquitty", "median", "centroid"),
  addrect = NULL,
  plotCI = c("n", "square", "circle", "rect"),
  bg = "white",
  mar = c(0, 0, 0, 0),
  ...
)

Arguments

cor_matrix

Matrix, the correlation matrix to visualize.

cor_test

A list of matrix return by corrplot::cor.mtest() which contains:

  • p: Square matrix of size FxF with p-values as cells.

  • lowCI: Square matrix of size FxF, each cell represents the lower part of a confidence interval.

  • uppCI: Square matrix of size FxF, each cell represents the upper part of a confidence interval.

lower

A Character, the visualization method for the lower triangular correlation matrix.

upper

A Character, the visualization method for the upper triangular correlation matrix.

lower.col

Passed as col parameter to the lower matrix.

upper.col

Passed as col parameter to the upper matrix.

order

Character, the ordering method of the correlation matrix. "original" for original order (default). * "AOE" for the angular order of the eigenvectors. * "FPC" for the first principal component order. * "hclust" for the hierarchical clustering order. * "alphabet" for alphabetical order. See order parameter in corrplot::corrplot().

hclust.method

A Character, the agglomeration method to be used when order is stats::hclust(). This should be one of "ward", "ward.D", "ward.D2", "single", "complete", "average", "mcquitty", "median" or "centroid".See hclust.method parameter in corrplot::corrplot().

addrect

A Integer, the number of rectangles draws on the graph according to the hierarchical cluster, only valid when order is hclust. If NULL (default), then add no rectangles.

plotCI

See the plotCI parameter in corrplot::corrplot().

bg

The background color.

mar

See graphics::par().

...

Additional arguments for corrplot::corrplot()'s wrappers.

Value

(Invisibly) returns a reordered correlation matrix.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
## Not run: 

# Prepare cor matrix
cor_matrix <- cor(mtcars)
cor_test <- corrplot::cor.mtest(cor_matrix)

# Plot a customized corplot wich cluster segments
corrplot_mixed(cor_matrix,
  cor_test = cor_test,
  order = "hclust", addrect = 3
)

# Plot a customized corplot wich cluster segments and CI.
corrplot_mixed(cor_matrix,
  cor_test = cor_test,
  order = "hclust", addrect = 3,
  plotCI = "rect"
)

## End(Not run)

chriszheng2016/zstexplorer documentation built on June 13, 2021, 9:47 a.m.