plot_elbow: Create Elbow Plot for K-Means

View source: R/visualization.R

plot_elbowR Documentation

Create Elbow Plot for K-Means

Description

Plot total within-cluster sum of squares vs number of clusters

Usage

plot_elbow(wss_data, add_line = FALSE, suggested_k = NULL)

Arguments

wss_data

A tibble with columns k and tot_withinss (from calc_wss)

add_line

Add vertical line at suggested optimal k? (default: FALSE)

suggested_k

If add_line=TRUE, which k to highlight

Value

A ggplot object


tidylearn documentation built on Feb. 6, 2026, 5:07 p.m.