kMeans: Run a k-means clustering analysis

Description Usage Arguments Details Value Examples

Description

Run a k-means clustering analysis, returning a list of cluster assignments

Usage

1
kMeans(data, clusters)

Arguments

data

A matrix of data values

clusters

An integer specifying the number of clusters

Details

This function performs a k-means clustering analysis on the given data set.

Value

A list with cluster assignments

Examples

1
2
3
4
5
6
7
x <- rbind(matrix(rnorm(100, sd = 0.3), ncol = 2),
           matrix(rnorm(100, mean = 1, sd = 0.3), ncol = 2))
colnames(x) <- c("x", "y")
cl <- kMeans(x, 2)

data(trees, package="datasets")
cl2 <- kMeans(t(trees),3)

eddelbuettel/rcppmlpack2 documentation built on May 15, 2019, 10:33 p.m.