Learn R Programming

fpc (version 1.2-2)

pamk: Partitioning around medoids with estimation of number of clusters

Description

This calls the function pam to perform a partitioning around medoids clustering with the number of clusters estimated by optimum average silhouette width.

Usage

pamk(data,krange=2:10,scaling=FALSE, diss=inherits(data, "dist"),...)

Arguments

data
a data matrix or data frame, or dissimilarity matrix or object. See pam for more information.
krange
integer vector. Numbers of clusters which are to be compared by the average silhouette width criterion. Note: This can't estimate number of clusters nc=1, and therefore 1 should not be in krange.
scaling
either a logical value or a numeric vector of length equal to the number of variables. If scaling is a numeric vector with length equal to the number of variables, then each variable is divided by the corresponding value from
diss
logical flag: if TRUE (default for dist or dissimilarity-objects), then data will be considered as a dissimilarity matrix. If FALSE, then data will be considered as
...
further arguments to be transferred to pam.

Value

  • A list with components
  • pamobjectThe output of the optimal run of the pam-function.
  • ncthe optimal number of clusters.

References

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

See Also

pam

Examples

Run this code
set.seed(20000)
  face <- rFace(50,dMoNo=2,dNoEy=0,p=2)
  pk <- pamk(face)

Run the code above in your browser using DataLab