summary.kMeans: Summarise results of k-means clustering

Description Usage Arguments Value See Also Examples

View source: R/summary.R

Description

summary method for class "kMeans".

Usage

1
2
## S3 method for class 'kMeans'
summary(object, ...)

Arguments

object

an object of class "kMeans", usually a result of a call to kMeansLloyd.

...

further arguments passed to or from other methods.

Value

The function summary.kMeans returns a list of class kMeansSummary. In addition to the elements of an object of class "kMeans", it contains the following elements:

totalSS

total sum of squares.

betweenSS

between sum of squares

See Also

kMeansLloyd, print.kMeansSummary

Examples

1
2
3
4
5
6
7
8
9
# create example data set
X <- rbind(matrix(rnorm(50, sd = 0.5), ncol = 2),
matrix(rnorm(50, mean = 1, sd = 0.5), ncol = 2))

# perform k-means algorithm
result <- kMeansLloyd(x = X, centroids = 2, nStart = 2)

# summarise result
summary(result)

heiligerl/kMeans_Rpackage documentation built on Aug. 16, 2020, 4:04 p.m.