View source: R/silhouette.km.R
silhouette.km | R Documentation |
K
-Means ClusteringFind the silhouettes (12.9) for K-means clustering from the data and and the groups' centers.
silhouette.km(x, centers)
x |
The |
centers |
The |
This function is a bit different from the silhouette function in the cluster package, Maechler et al., 2005.
The n
-vector of silhouettes, indexed by the observations'
indices.
# Uses sports data.
data(sportsranks)
# Obtain the K-means clustering for sports ranks.
kms <- kmeans(sportsranks, centers = 5, nstart = 10)
# Silhouettes
sil <- silhouette.km(sportsranks, kms$centers)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.