Learn R Programming

fdm2id (version 0.9.6)

KMEANS: K-means method

Description

Run K-means for clustering.

Usage

KMEANS(
  d,
  k = 9,
  criterion = c("none", "pseudo-F"),
  graph = FALSE,
  nstart = 10,
  ...
)

Value

The clustering (kmeans object).

Arguments

d

The dataset (matrix or data.frame).

k

The number of cluster.

criterion

The criterion for cluster number selection. If none, k is used, if not the number of cluster is selected between 2 and k.

graph

A logical indicating whether or not a graphic should be plotted (cluster number selection).

nstart

Define how many random sets should be chosen.

...

Other parameters.

See Also

kmeans, predict.kmeans

Examples

Run this code
require (datasets)
data (iris)
KMEANS (iris [, -5], k = 3)
KMEANS (iris [, -5], criterion = "pseudo-F") # With automatic detection of the nmber of clusters

Run the code above in your browser using DataLab