Computes the medoids of clusters

Description

Computes the medoids of a cluster solution.

Usage

1
medoids(D, cl)

Arguments

D

square distance matrix (n rows * n columns, i.e. n individuals) or dist object

cl

vector with the clustering solution (its length should be n)

Details

Medoids are representative objects of a cluster whose average dissimilarity to all the objects in the cluster is minimal. Medoids are always members of the data set (contrary to means or centroids).

Value

Returns a numeric vector with the indexes of medoids.

Author(s)

Nicolas Robette

References

Kaufman, L. and Rousseeuw, P.J. (1990). Finding Groups in Data: An Introduction to Cluster Analysis. Wiley, New York.

Anja Struyf, Mia Hubert & Peter J. Rousseeuw (1996). "Clustering in an Object-Oriented Environment". Journal of Statistical Software.

See Also

dist, cluster, hclust, cutree , pam

Examples

1
2
3
4
5
6
7
8
## Performs of classification of the 'Music' example data set, 
## a clustering in 3 groups
## and then computes the medoids.
data(Music)
temp <- dichotom(Music[,1:5])
d <- dist(temp)
clus <- cutree(hclust(d),3)
medoids(d,clus)

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.