autoplot.kmeans: Autoplot cluster instances

Description Usage Arguments Value Examples

View source: R/fortify_cluster.R

Description

Autoplot cluster instances

Usage

1
2
## S3 method for class 'kmeans'
autoplot(object, data = NULL, colour = "cluster", ...)

Arguments

object

Clustered instance

data

Original data used for clustering. Mandatory for stats::kmeans.

colour

line colour for points

...

other arguments passed to autoplot::prcomp

Value

ggplot

Examples

1
2
3
4
5
6
autoplot(stats::kmeans(iris[-5], 3), data = iris)
autoplot(cluster::clara(iris[-5], 3), label = TRUE)
autoplot(cluster::fanny(iris[-5], 3))
autoplot(cluster::fanny(iris[-5], 3), frame = TRUE)
autoplot(cluster::pam(iris[-5], 3), data = iris, colour = 'Species')
autoplot(cluster::pam(iris[-5], 3), data = iris, frame = TRUE, frame.type = 't')

ggfortify documentation built on May 29, 2017, 11:37 p.m.