mu_heatmap: create a heatmap

View source: R/correlation_plot.R

mu_heatmapR Documentation

create a heatmap

Description

given a matrix denoting either distance or similarity, create a heatmap.

Usage

mu_heatmap(
  matrix_data,
  title = "",
  groups = NULL,
  transform = "none",
  min_value = 0,
  ...
)

Arguments

matrix_data

matrix of binary distances

title

the title of the data

groups

data.frame of groups (default = NULL)

transform

how to transform the data for similarity reordering

min_value

the minimum value to use (default = 0)

...

other parameters for ComplexHeatmap

Examples

## Not run: 
library(metabolomicsUtilities)
set.seed(1234)
mat <- matrix(rnorm(100, 2, sd = 0.5), 10, 10)
rownames(mat) <- colnames(mat) <- letters[1:10]

sample_class <- data.frame(grp = rep(c("grp1", "grp2"), each = 5), stringsAsFactors = FALSE)
rownames(sample_class) <- rownames(mat)

mu_heatmap(mat, groups = sample_class[, "grp", drop = FALSE])

# if there is a class with only one member, it is dropped, with a warning
sample_class[10, "grp"] = "grp3"
mu_heatmap(mat, groups = sample_class[, "grp", drop = FALSE])

## End(Not run)

rmflight/metabolomicsUtilities documentation built on Oct. 28, 2023, 6:41 p.m.