cluster.elbow: Visually inspect the optimal numbers of clusters

Description Usage Arguments Value Author(s) Examples

Description

A convenient wrapper for factoextra::fviz_nbclust, which plot within cluster sums of squares, average silhouette and gap statistics for clustering. The required parameters and their corresponding documentations are simplified versions of that in factoextra::fviz_nbclust.

Usage

1
2
3
4
5
6
7
cluster.elbow(
  dat,
  FUNcluster,
  method = c("wss", "silhouette", "gap_stat"),
  k.max = 10,
  ...
)

Arguments

dat

an input data.

FUNcluster

a partitioning function which accepts as first argument a (data) matrix like x, second argument, say k, k >= 2, the number of clusters desired, and returns a list with a component named cluster which contains the grouping of observations. By default, "kmeans".

method

the method to be used for estimating the optimal number of clusters. Possible values are "silhouette" (for average silhouette width), "wss" (for total within sum of square) and "gap_stat" (for gap statistics).

k.max

the maximum number of clusters to consider. By default, 10.

...

optional arguments. See or directly use factoextra::fviz_nbclust.

Value

cluster.elbow returns a ggplot2 object.

Author(s)

Neo Christopher Chung nchchung@gmail.com

Examples

1
2
3
4
5
## Not run: 
data(coptm)
cluster.elbow(dat=optm, FUNcluster=kmeans, method="wss", k.max=10, linecolor="black")

## End(Not run)

UCLA-BD2K/CV.Signature.TCP documentation built on May 15, 2020, 11:27 p.m.