GG_heatmap: Heatmap correlation matrix with ggplot2

View source: R/plotting.R

GG_heatmapR Documentation

Heatmap correlation matrix with ggplot2

Description

Heatmap correlation matrix with ggplot2

Usage

GG_heatmap(
  data,
  add_values = T,
  reorder_vars = T,
  digits = 2,
  font_size = 4,
  color_label = "Pearson\nCorrelation",
  legend_position = c(0.6, 0.7),
  short_x_labels = F,
  axis_labels_clean_func = str_clean
)

Arguments

data

Data frame or a matrix

add_values

Whether to add the correlation sizes as text to plot

reorder_vars

Whether to reorder variables so strongly related ones are close to each other

digits

How many digits to print when plotting them

font_size

If correlation values are plotted, their size

color_label

Which label to use for the color scale legend

legend_position

Position of the legend. Sometimes you may need to move it a bit

short_x_labels

Adds integers to the y axis labels, and replaces the x labels with the same integers. Useful when there are many variables.

axis_labels_clean_func

A function to clean the labels with, typically to remove underscores. NULL means disable.

Value

a ggplot2 object


Deleetdk/kirkegaard documentation built on May 2, 2024, 7:12 p.m.