Skip to contents

Retrieve the dendrogram leaf order

Usage

cluster_order(data, method = "complete")

Arguments

data

A numeric matrix or data frame whose rows are the categorical levels to cluster (rownames() give the labels) and whose columns are the features used for clustering. Alternatively an hclust object, or — for scale_x_cluster() / scale_y_cluster() — omitted, in which case the matrix is derived from the plot's own data (see Details).

method

Clustering method passed to stats::hclust(). One of "ward.D", "ward.D2", "single", "complete", "average", "mcquitty", "median" or "centroid".

Value

A character vector of labels in dendrogram leaf order.