kMeans: Run a k-means clustering analysis

Description Usage Arguments Details Value Examples

View source: R/RcppExports.R

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 Feb. 2, 2021, 1:51 a.m.