Description Usage Arguments Value Author(s) Examples
View source: R/ggheatmap_anno_variable.R
Draw a heatmap of the grouped variables, and add grouped information to the result of ggheatmap
1 |
data |
a data.frame containing the variables information and the grouping information |
a ggplot2 type of heatmap containing only one collumn
Zhonghui Gai
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.