print.kMeansSummary: Printing the summary of k-means clustering

Description Usage Arguments Value Examples

View source: R/printSummary.R

Description

print method for class "kMeansSummary".

Usage

1
2
## S3 method for class 'kMeansSummary'
print(x, ...)

Arguments

x

an object of class "kMeansSummary", usually a result of the call summary.kMeans.

...

further arguments passed to or from other methods.

Value

The method prints the within sum of squares, the total within sum of squares, the between sum of squares and the total sum of squares that result from calling summary.kMeans.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
# 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
clustSum <- summary(result)
print(clustSum)

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