correlationHeatmap: Plot a Heatmap for a Correlation Matrix

Description Usage Arguments Value Examples

View source: R/utility_functions.R

Description

Generates a heatmap of the upper triangle of a correlation matrix.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
correlationHeatmap(
  df,
  ttl = "Correlation matrix",
  labels = NULL,
  new = T,
  lyt = NULL,
  gradient = c("orange", "blue"),
  txtSz = 1.25,
  mc_adjust = "BH",
  cut_off = 0.05,
  H = 20/3,
  W = 25/3
)

Arguments

df

a data frame with all variables to include in the correlation matrix.

ttl

an optional title for the figure.

labels

the labels for the rows/columns.

new

logical; if TRUE generates a new plotting window.

lyt

an optional matrix specifying the layout of the main panel (1) versus the side panel (2) with the color gradient.

gradient

the final end colors for the negative and positive correlations, respectively.

txtSz

the size of the text in the figure.

mc_adjust

the method to use when correcting for multiple comparisons (see ).

cut_off

cut-off for significance.

H

the height to use if a new plotting window is generated.

W

the width to use if a new plotting window is generated.

Value

A heatmap for the upper-triangle portion of the correlation matrix.

Examples

1
2
3
4
5
# Load data
data("mtcars")
my_data <- mtcars[, c(1,3,4,5,6,7)]
# Generate heatmap
correlationHeatmap( my_data, labels = colnames(my_data) )

rettopnivek/utilityf documentation built on March 1, 2021, 7:05 p.m.