| PAM | R Documentation |
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.
PAM(
d,
k = 9,
criterion = c("none", "silhouette"),
graph = FALSE,
seed = NULL,
...
)
d |
The dataset ( |
k |
The number of clusters. |
criterion |
How |
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. |
... |
Other parameters, passed to |
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.
KMEANS, pam, kmeans.getk
require (datasets)
data (iris)
model = PAM (iris [, -5], 3)
model$medoids
table (model$cluster, iris [, 5])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.