ggheatmap_anno_variable: Draw a heatmap of the grouped variables, and add grouped...

Description Usage Arguments Value Author(s) Examples

View source: R/ggheatmap_anno_variable.R

Description

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

Usage

1

Arguments

data

a data.frame containing the variables information and the grouping information

Value

a ggplot2 type of heatmap containing only one collumn

Author(s)

Zhonghui Gai

Examples

1
2
3
4
5
6
7
8
9
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.variables <- data.frame(variables = colnames(iris)[1:4],
group = c(rep("grp1", 2), rep("grp2", 2)))

p.variable <- ggheatmap_anno_variable(data = anno.variables) + ggsci::scale_fill_lancet()
p %>% aplot::insert_left(p.variable, width = 0.03)

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