Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

adjust_dend_by_x

Adjust the Positions of nodes/leaves in the Dendrogram


Description

Adjust the Positions of nodes/leaves in the Dendrogram

Usage

adjust_dend_by_x(dend, leaf_pos = 1:nobs(dend)-0.5)

Arguments

dend

A dendrogram object.

leaf_pos

A vector of positions of leaves. The value can also be a unit object.

Details

The positions of nodes stored as x attribute are recalculated based on the new positions of leaves.

By default, the position of leaves are at 0.5, 1.5, ..., n-0.5.

Examples

m = matrix(rnorm(100), 10)
dend = as.dendrogram(hclust(dist(m)))
dend = adjust_dend_by_x(dend, sort(runif(10)))
str(dend)
dend = adjust_dend_by_x(dend, unit(1:10, "cm"))
str(dend)

ComplexHeatmap

Make Complex Heatmaps

v2.6.2
MIT + file LICENSE
Authors
Zuguang Gu
Initial release
2020-11-12

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.