kmeans_report: Plot data according to cluster assigments

Description Usage Arguments Value Examples

Description

Plot data according to cluster assigments

Usage

1
kmeans_report(clustered_data)

Arguments

clustered_data

– the data object (data frame or matrix) that k-means clustering has been applied to

Value

plot – a scatter plot of the data coloured by cluster assignment (if 2D data) – a data frame reporting points and their cluster assignemnts

Examples

1
2
3
4
5
6
7
x <- runif(100, min = 0, max = 10) + rep(c(0, 10), 50)
y <- rnorm(100, 5, 1) + rep(c(0, 10), 50)
data = data.frame(x = x, y = y)

centers <- kmeans_init(data = data, K = 2)
clustered_data <- kmeans_cluster(data=data, centers=centers)
kmeans_report(clustered_data)

UBC-MDS/kmeans_R documentation built on May 22, 2019, 2:26 p.m.