arrange_dendrogram: Arrange dendrograms with heatmap

Description Usage Arguments Value Examples

View source: R/arrange_dendrogram.R

Description

Arranges both dendrograms with heatmap.

Usage

1
2
3
4
5
6
7
8
arrange_dendrogram(
  heatmap,
  dendrogram_top,
  dendrogram_right,
  top_right = NULL,
  widths = c(0.8, 0.2),
  heights = c(0.2, 0.8)
)

Arguments

heatmap

object containing heatmap plot

dendrogram_top

top dendrogram plot generated with plot_dendrogram

dendrogram_right

right dendrogram plot generated with plot_dendrogram

top_right

element placed in the top right part of the plot. By default NULL leaving empty space.

widths

numeric vector of heatmap and right dendrogram widths

heights

numeric vector of top dendrogram and heatmap heights

Value

plot with heatmap and aligned dendrograms

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
library(ggplot2)
data(example_data)
dendro_top <- plot_dendrogram(d1)
dendro_right <- plot_dendrogram(d2) + coord_flip()

# Plot aligned dendrograms with legend at the bottom
arrange_dendrogram(hm + theme_bw() + theme(legend.position = "bottom"),
dendro_top + theme_void(), dendro_right + theme_void())

# Plot aligned dendrograms with legend in the top right corner
arrange_dendrogram(hm + theme_bw() + theme(legend.position = "none"),
dendro_top + theme_void(), dendro_right + theme_void(), get_legend(hm))

michbur/dendrolenda documentation built on Aug. 10, 2020, 4:55 a.m.