get_sil_widths | R Documentation |
This function extracts or calculates the silhouette widths from the clustering objects
get_sil_widths(obj, diss_matrix)
obj |
A clustering object |
diss_matrix |
A dissimilarity matrix, of class 'dist' |
cluster::pam
retains a table of sil widths in obj$silinfo$widths
For the other cluster methods we calculate them ourselves using
cluster::silhouette
The clustering 'obj' must have a named 'cluster' vector. Named with the observation .rowid and the value the observation cluster membership
A tibble with the observation .rowid, the cluster membership, the cluster neighbor and the silhouette width
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.