sort_silhouette: Sort the silhouettes by group

Description Usage Arguments Value See Also Examples

View source: R/sort_silhouette.R

Description

Sorts the silhouettes, first by group, then by value, preparatory to plotting.

Usage

1
sort_silhouette(sil, cluster)

Arguments

sil

The n-vector of silhouette values.

cluster

The n-vector of cluster indices.

Value

The n-vector of sorted silhouettes.

See Also

silhouette.km

Examples

1
2
3
4
5
6
7
8
9
# 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)

msos documentation built on Oct. 31, 2020, 9:07 a.m.