autoplot.silhouette: Autoplot silhouette instances

View source: R/fortify_cluster.R

autoplot.silhouetteR Documentation

Autoplot silhouette instances

Description

Autoplot silhouette instances

Usage

## S3 method for class 'silhouette'
autoplot(
  object,
  colour = "red",
  linetype = "dashed",
  size = 0.5,
  bar.width = 1,
  ...
)

Arguments

object

Silhouette instance

colour

reference line color

linetype

reference line type

size

reference line size

bar.width

bar width

...

other arguments passed to methods

Value

ggplot

Examples

## Not run: 
model = cluster::pam(iris[-5], 3L)
sil = cluster::silhouette(model)
autoplot(sil)

autoplot(cluster::silhouette(cluster::clara(iris[-5], 3)))
autoplot(cluster::silhouette(cluster::fanny(iris[-5], 3)))

model = stats::kmeans(iris[-5], 3)
sil = cluster::silhouette(model$cluster, stats::dist(iris[-5]))
autoplot(sil)

## End(Not run)

ggfortify documentation built on May 29, 2024, 7:19 a.m.