cut_clusters: Cut a hierarchical tree targeting k clusters

View source: R/utils_clustering.R

cut_clustersR Documentation

Cut a hierarchical tree targeting k clusters

Description

Cut a hierarchical tree targeting k clusters

Usage

cut_clusters(clusters, k)

Arguments

clusters

cluster results, produced by e.g. fastcluster::hclust()

k

target number of clusters

Value

cluster labels

Examples

dmat <- compute_dmat(iris, "euclidean", TRUE, c("Petal.Length", "Sepal.Length"))
clusters <- compute_clusters(dmat, "complete")
cluster_labels <- cut_clusters(clusters, 2)
head(cluster_labels)

visxhclust documentation built on March 31, 2023, 7:30 p.m.