ggcormatrix: Visualize a Correlation Matrix using ggplot2

Description Usage Arguments Details Author(s)

View source: R/ggcormatrix.R

Description

Visualize a Correlation Matrix using ggplot2

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
ggcormatrix(
  x,
  determination = T,
  hc.order = F,
  fill = NULL,
  limit = NULL,
  midpoint = NULL,
  breaks = c(0, 0.2, 0.5, 0.8, 1),
  text.size = 9
)

Arguments

x

a pairwise correlation matrix

determination

logical stating if correlations should be transformed to coefficients of determination by squaring the values of x.

hc.order

a logical stating if rows and columns of x should be ordered according the a hierarchical tree with complete linkage.

fill

a user defined character vector of three strings of hexcodes defining the color scheme of the legend of the plot. Default NULL. See Details.

limit

limit values of the legend of the plot. Default NULL. See Details.

midpoint

the midpoint value for the transition of the fill gradient.

breaks

numeric values defining the ticks of the legend scale.

text.size

a numeric defining the size of the plot text.

Details

If determination is TRUE the color scheme of the plot is defined as: fill = c(low = "#FFFFFF", mid = "#808080", high = "#232323"). Otherwise, is defined as: fill <- c(low = "#3B9AB2", mid = "#FFFFFF", high = "#F21A00"). The first option generates a gray-scale plot. The second option generates a color gradient that goes from a blueish (negative correlation) to reddish (positive correlation) color. In both cases a zero correlation or determination coefficient is represent with white color. By default the limit argument is NULL which means that this values is determined internally. limit is definied a numeric vector of two elements defining the range of the legend scale. For correlation it is c(-1, 1) and for determination = T is c(0, 1). User can supply its own values which might be help for if observed values of x have a limited or very similar range.

Author(s)

David Senhora Navega


dsnavega/cbfsr documentation built on Jan. 1, 2021, 12:07 a.m.