fortify.silhouette: Convert 'cluster::silhouette' to 'data.frame'

Description Usage Arguments Value Examples

View source: R/fortify_cluster.R

Description

Convert cluster::silhouette to data.frame

Usage

1
2
## S3 method for class 'silhouette'
fortify(model, data = NULL, ...)

Arguments

model

Silhouette instance

data

original dataset, if needed

...

other arguments passed to methods

Value

data.frame

Examples

1
2
3
4
5
6
fortify(cluster::silhouette(cluster::pam(iris[-5], 3)))
fortify(cluster::silhouette(cluster::clara(iris[-5], 3)))
fortify(cluster::silhouette(cluster::fanny(iris[-5], 3)))

mod = stats::kmeans(iris[-5], 3)
fortify(cluster::silhouette(mod$cluster, stats::dist(iris[-5])))

ggfortify documentation built on July 8, 2021, 1:07 a.m.