Learn R Programming

rtemis (version 1.4.3)

clusters: Get cluster assignments from Clustering

Description

Returns the cluster each case of the data a Clustering was fitted on is assigned to.

Usage

clusters(x)

Value

Integer vector: One cluster label per case.

Arguments

x

Clustering: A Clustering object.

Author

EDG

Details

Cluster labels are integers from 1 to the number of clusters fitted. An algorithm with a noise label, such as DBSCAN, labels noise cases 0. A soft clustering assigns each case to the cluster of its highest membership; get_membership() returns the membership matrix.

Examples

Run this code
if (FALSE) { # requireNamespace("flexclust", quietly = TRUE)
iris_km <- cluster(exc(iris, "Species"), algorithm = "KMeans", verbosity = 0L)
clusters(iris_km)
}

Run the code above in your browser using DataLab