Silhouette function {Rfast2} | R Documentation |
Silhouette function
Description
Silhouette function.
Usage
silhouette(x, cl, type = "euclidean")
Arguments
x |
A numerical matrix with the data. |
cl |
A numerical vector with the group clusterings. |
type |
The type of distance, by default it is the Euclidean. |
Details
The silhouettes are computed.
Value
A list including:
si |
A matrix with two columns, the clusters and the silhouette function, for each observation. |
stats |
A matrix with 4 columns. The number of observations in each cluster, the minimum, maximum and average silhouette for each cluster. |
Author(s)
Michail Tsagris and Nikolaos Kontemeniotis.
R implementation and documentation: Michail Tsagris mtsagris@uoc.gr and Nikolaos Kontemeniotis kontemeniotisn@gmail.com.
References
Rousseeuw P. J. (1987). Silhouettes: a graphical aid to the interpretation and validation of cluster analysis. Journal of Computational and Applied Mathematics, 20, 53–65.
See Also
Examples
x <- as.matrix( iris[1:100, 1:4] )
cl <- kmeans(x, 2)$cluster
silhouette(x, cl)