Learn R Programming

sjPlot (version 2.1.0)

sjc.elbow: Compute elbow values of a k-means cluster analysis

Description

Plot elbow values of a k-means cluster analysis. This function computes a k-means cluster analysis on the provided data frame and produces two plots: one with the different elbow values and a second plot that maps the differences between each "step" (i.e. between elbow values) on the y-axis. An increase in the second plot may indicate the elbow criterion.

Usage

sjc.elbow(data, steps = 15, show.diff = FALSE)

Arguments

data
data frame containing all variables that should be used for determining the elbow criteria
steps
maximum group-count for the k-means cluster analysis for which the elbow-criterion should be displayed. Default is 15.
show.diff
logical, if TRUE, an additional plot with the differences between each fusion step of the Elbow criterion calculation is shown. This plot may help identifying the "elbow". Default for this argument is FALSE.

Examples

Run this code
# plot elbow values of mtcars dataset
sjc.elbow(mtcars)

Run the code above in your browser using DataLab