matrix_heatmap: Heatmap grid

matrix_heatmapR Documentation

Heatmap grid

Description

Creates a heatmap based on a matrix of values.

Usage

matrix_heatmap(
  data,
  digits = 2,
  text_size = 4.5,
  legend_height = 20,
  row_ids = NULL,
  col_ids = NULL,
  add_border = F,
  border_color = "black",
  border_size = 1,
  border_cutoff = 0,
  border_cutoff_invert = F,
  ggfill = scale_fill_gradient2(name = "", low = "steelblue4", mid = "white", high =
    "red4", breaks = seq(-1, 1, 0.1), limits = c(-1, 1)),
  reorder_matrix = T,
  title = NULL,
  x_title = NULL,
  y_title = NULL,
  xlab_pos = c("bottom", "top"),
  ylab_pos = c("left", "right")
)

Arguments

data

A data frame or matrix of numeric values.

digits

An integer for how many digits to which to round cell values.

text_size

A numeric value for the cell value text size.

legend_height

A numeric for the height of the legend key in millimeters.

row_ids

An optional string vector of row names to retain for plotting.

col_ids

An optional string vector of column names to retain for plotting.

add_border

A boolean for whether certain cells be annotated with a specific border color based on border_cutoff.

border_color

A string for the cell border color. Only applies if add_border is TRUE.

border_size

A numeric for the cell border thickness. Only applies if add_border is TRUE.

border_cutoff

A numeric for the cutoff to use when determining which cells to annotate with border_color color. Selects cells with a value less than the specified value. Only applies if add_border is TRUE.

border_cutoff_invert

A boolean for whether to select cells with a value greater than the specified value of border_cutoff. Only applies if add_border is TRUE.

ggfill

An object returned by the family of scale_fill_* functions for continuous values that defines the color fill for the cells of the heatmap.

reorder_matrix

A boolean indicating if the columns and rows should be reordered such that the diagonal cells equate to the same x and y axis labels.

title

A string for the plot title.

x_title

A string for the x-axis title.

y_title

A string for the y-axis title.

xlab_pos

The x-axis label position. One of "top", "bottom".

ylab_pos

The y-axis label position. One of "left", "right".

Value

A ggplot2 object

See Also

assoc_matrix


bryancquach/omixjutsu documentation built on Jan. 29, 2023, 3:47 p.m.