depth: Find minimum/maximum depth of a dendrogram

Description Usage Arguments Value Examples

Description

As the name implies. This can also work for non-dendrogram nested lists.

Usage

1
2
3
min_depth(dend, ...)

max_depth(dend, ...)

Arguments

dend

Any nested list object (including dendrogram).

...

unused at the moment.

Value

Integer, the (min/max) number of nodes from the root to the leafs

Examples

1
2
3
4
5
6
7
8
hc <- hclust(dist(USArrests), "ave")
(dend1 <- as.dendrogram(hc)) # "print()" method
is.list(dend1)
is.list(dend1[[1]][[1]][[1]])
dend1[[1]][[1]][[1]]
plot(dend1)
min_depth(dend1)
max_depth(dend1)

dendextend documentation built on May 9, 2021, 1:06 a.m.