Learn R Programming

Kmisc (version 0.5.0)

kmeans_plot: k-means Diagnostic Plot

Description

Using kmeans, plot percentage variance explained vs. number of clusters. Used as a means of picking k.

Usage

kmeans_plot(dat, nmax = 20, ...)

Arguments

dat
numeric matrix of data, or an object that can be coerced to such a matrix (such as a numeric vector or a data frame with all numeric columns).
nmax
maximum number of clusters to examine
...
optional arguments passed to xyplot

See Also

kmeans

Examples

Run this code
data(iris)
kmeans_plot(iris[,1:4])

Run the code above in your browser using DataLab