Learn R Programming

dendroextras (version 0.2.4)

labels.hclust: Find labels of hclust object (in dendrogram order)

Description

NB will return labels in dendrogram order, not in the order of the original labels retained in object$labels ususally corresponding to the row or column names of the dist object provided to hclust.

Usage

# S3 method for hclust
labels(object, ...)

Value

character vector of labels in dendrogram order

Arguments

object

hclust object from which to extract labels

...

Additional arguments (ignored)

Author

jefferis

See Also

Examples

Run this code
hc <- hclust(dist(USArrests), "ave")
dend <- as.dendrogram(hc)
stopifnot(all.equal(labels(hc),labels(dend)))

Run the code above in your browser using DataLab