heat_matrix: Plot heatmap from a matrix

View source: R/plotting.R

heat_matrixR Documentation

Plot heatmap from a matrix

Description

Plot heatmap from a matrix

Usage

heat_matrix(mat, base_size = 12, digits = 2, show_value = FALSE)

Arguments

mat

A matrix to show, column by x-axis and row by y-axis

base_size

Numeric value for the base size in theme_bw

digits

Integer value for the number of digits to show

show_value

Logical value for showing the value for each element or not

Value

A ggplot heatmap visualization of the passed matrix.

Examples

mat <- matrix(rnorm(9), ncol = 3, nrow = 3) + diag(rnorm(3, 2, 0.1))
rownames(mat) <- paste0("sample_", letters[1:3])
colnames(mat) <- paste0("var_", 1:3)
heat_matrix(mat)

# Additional arguments. 
heat_matrix(mat, base_size = 6)
heat_matrix(mat, show_value = TRUE)
heat_matrix(mat, show_value = TRUE, digits = 4)

davismcc/cardelino documentation built on Nov. 19, 2022, 2:44 a.m.