ggheatmap_anno_sample: Draw a heatmap of the grouped samples, and add group...

Description Usage Arguments Value Author(s) Examples

View source: R/ggheatmap_anno_sample.R

Description

Draw a heatmap of the grouped samples, and add group information to the result of ggheatmap

Usage

1

Arguments

data

a data.frame containg the samples information and the grouping information

Value

a ggplot2 type of heatmap containing only one row

Author(s)

Zhonghui Gai

Examples

1
2
3
4
5
6
7
8
data <- rowname_to_col(iris)
data <- data[,-6]
data$samples <- factor(data$samples, levels = data$samples)
p <- ggheatmap(data = data, midpoint = 2, scale = TRUE)
anno.samples <- data.frame(group = iris$Species,
samples = data$samples)
p.sample <- ggheatmap_anno_sample(data = anno.samples) + ggsci::scale_fill_jama()
p %>% aplot::insert_top(p.sample, height = 0.01)

ZhonghuiGai/ggheatmap documentation built on Dec. 18, 2021, 8:28 p.m.