PlotElbowKmeans: Return a plot with within-group sum of squares as function of...

Description Usage Arguments Value See Also Examples

View source: R/plot_elbow_kmeans.r

Description

An "elbow plot" hopefully shows you how many clusters are appropriate, as indicated by a minimal reduction in within-group sum of squares upon increasing k. In reality, few data sets will show such an elbow, but it is nonetheless a common method. Removes incomplete records.

Usage

1
PlotElbowKmeans(df, max.clusters = 15, plot.title = "")

Arguments

df

dataframe ready for kmeans (e.g. scaled)

max.clusters

how to deal with missing values, see stats::cor

plot.title

string to add to plot

Value

ggplot object

See Also

stats::kmeans which this function wraps, and https://stackoverflow.com/questions/15376075/cluster-analysis-in-r-determine-the-optimal-number-of-clusters for original code

Examples

1

petersmittenaar/peterr documentation built on Feb. 13, 2021, 9:20 p.m.