num_clusters: Get the number of clusters.

View source: R/pham.R

num_clustersR Documentation

Get the number of clusters.

Description

The optimal number of clusters proposed by the method.

Usage

num_clusters(obj)

Arguments

obj

the output of kselection function.

Value

the number of clusters proposed.

Author(s)

Daniel Rodriguez

See Also

num_clusters_all, get_f_k

Examples

# Create a data set with two clusters
dat <- matrix(c(rnorm(100, 2, .1), rnorm(100, 3, .1),
                rnorm(100, -2, .1), rnorm(100, -3, .1)), 200, 2)

# Get the optimal number of clustes
sol <- kselection(dat)
k   <- num_clusters(sol)


drodriguezperez/kselection documentation built on May 24, 2022, 8:34 p.m.