Partitions the data into k clusters around medoids -- actual observations of
the dataset -- rather than around means. Being an observation, a medoid can be shown to
students as a representative example of its cluster, and the method tolerates outliers much
better than K-means, which drags a mean towards them.
The clustering, as an object of class pam (see pam),
with a cluster component holding the assignments and a medoids one holding the
representative observations.
Arguments
d
The dataset (matrix or data.frame).
k
The number of clusters.
criterion
How k is chosen, as in KMEANS. With "none" (the
default) k is used as it is; with "silhouette" it is chosen between 2 and
k by the mean silhouette width, the criterion PAM itself optimises the closest.
graph
A logical indicating whether the criterion curve is plotted.
seed
A specified seed for random number generation. PAM's initialisation is
deterministic, so this only matters for the criterion search.