Learn R Programming

dendextend (version 1.1.2)

prune_leaf: Trimms one leaf from a dendrogram

Description

Trimms 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

Value

  • A dendrogram with a leaf pruned

Details

Used through prune

Examples

Run this code
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")

Run the code above in your browser using DataLab