Learn R Programming

dendextendRcpp (version 0.6.1)

dendextendRcpp_labels.dendrogram: Find Labels from a dendrogram Object using Rcpp

Description

Extract the leaves labels from a dendrogram object.

Usage

dendextendRcpp_labels.dendrogram(object, warn = FALSE, ...)

Arguments

object
a dendrogram object.
warn
logical (FALSE) - should the user be warned if reverting to default? (I set it to FALSE since it can be very noisy sometimes...)
...
not used.

Value

A vector of labels from the dendrogram leaves. This is often a character vector, but there are cases it might be integer.

Source

R-devel-mailing list.

See Also

labels, dendrogram

Examples

Run this code
dend <- as.dendrogram(hclust(dist(USArrests)))

labels(dend)

## Not run: 
# # require(microbenchmark)
# microbenchmark::microbenchmark(dendextendRcpp::stats_labels.dendrogram(dend),
#                dendextendRcpp::dendextendRcpp_labels.dendrogram(dend),
#                times = 100)
# # about 30 times faster. It is faster the larger the tree is.
# ## End(Not run)

Run the code above in your browser using DataLab