Sort the silhouettes by group
Sorts the silhouettes, first by group, then by value, preparatory to plotting.
sort_silhouette(sil, cluster)
sil
: The -vector of silhouette values.cluster
: The -vector of cluster indices.The -vector of sorted silhouettes.
# 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)
silhouette.km
Useful links