plot_silhouette: Plot Silhouette Diagram

View source: R/plot_silhouette.R

plot_silhouetteR Documentation

Plot Silhouette Diagram

Description

Plots the silhouette diagram for a given clustering result.

Usage

plot_silhouette(sil)

Arguments

sil

A silhouette object as returned by silhouette.

Value

A silhouette plot if input is not NULL, otherwise a placeholder text.

Examples

data <- scale(iris[, 1:4])
cl <- kmeans(data, 3)$cluster
sil <- cluster::silhouette(cl, dist(data))
if (interactive()) {
  plot_silhouette(sil)
}



clusterWebApp documentation built on Aug. 8, 2025, 6:09 p.m.