View source: R/sort_silhouette.R
sort_silhouette | R Documentation |
Sorts the silhouettes, first by group, then by value, preparatory to plotting.
sort_silhouette(sil, cluster)
sil |
The |
cluster |
The |
The n
-vector of sorted silhouettes.
silhouette.km
# 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)
ssil <- sort_silhouette(sil, kms$cluster)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.