prune_leaf: Trims one leaf from a dendrogram

View source: R/prune.R

prune_leafR Documentation

Trims one leaf from a dendrogram

Description

Trims (prunes) one leaf from a dendrogram.

Usage

prune_leaf(dend, leaf_name, ...)

Arguments

dend

dendrogram object

leaf_name

a character string as the label of the tip we wish to prune

...

passed on

Details

Used through prune

Value

A dendrogram with a leaf pruned

Examples

hc <- hclust(dist(USArrests[1:5, ]), "ave")
dend <- as.dendrogram(hc)

par(mfrow = c(1, 2))
plot(dend, main = "original tree")
plot(prune_leaf(dend, "Alaska"), main = "tree without Alaska")

talgalili/dendextend documentation built on Jan. 27, 2024, 7:43 p.m.