dendro: Make a dendrogram from an hclust object

View source: R/dendro.R

dendroR Documentation

Make a dendrogram from an hclust object

Description

Makes a dendrogram aligned to a chosen edge of the plot area. This function is useful for making a dendrogram to align next to a heatmap. It is used in the heat_map function.

Usage

dendro(
  clust,
  edge = c("bottom", "left", "top", "right"),
  plot_margin = sapply(c("top", "right", "bottom", "left"), function(x) ifelse(x ==
    edge, 0, 5.5)),
  size = 0.5
)

Arguments

clust

An hclust object.

edge

The edge of the plot window to which to align the dendrogram, possible values being 'bottom', 'left', 'top' and 'right'. For example, if the dendrogram is to be plotted above a heatmap, use edge = 'bottom'. Default: 'bottom'.

plot_margin

A numeric vector of margin sizes in pts, in the order top, right, bottom, left. Default: 0 for edge, 5.5 for all other margins.

size

The weight of the lines.

Value

A ggplot object.


m20ty/matkot documentation built on July 1, 2023, 8:11 p.m.