Description Usage Arguments Value See Also Examples
View source: R/plot_elbow_kmeans.r
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.
1 | PlotElbowKmeans(df, max.clusters = 15, plot.title = "")
|
df |
dataframe ready for kmeans (e.g. scaled) |
max.clusters |
how to deal with missing values, see |
plot.title |
string to add to plot |
ggplot object
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
1 | PlotElbowKmeans(iris[, 1:4])
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.