annotate_clusters {visxhclust} | R Documentation |
Annotate data frame with clusters
Description
Annotate data frame with clusters
Usage
annotate_clusters(df, cluster_labels, long = TRUE, selected_clusters = NULL)
Arguments
df |
a data frame |
cluster_labels |
list of cluster labels, automatically converted to factor. |
long |
if |
selected_clusters |
optional cluster labels to filter |
Details
Long data frame will have columns: Cluster
, Measurement
and Value
.
Value
a wide or long data frame
Examples
dmat <- compute_dmat(iris, "euclidean", TRUE, c("Petal.Length", "Sepal.Length"))
res <- compute_clusters(dmat, "complete")
cluster_labels <- cut_clusters(res, 2)
annotated_data <- annotate_clusters(iris[, c("Petal.Length", "Sepal.Length")], cluster_labels)
head(annotated_data)
[Package visxhclust version 1.1.0 Index]