Number of clusters to extract
This function runs many existing procedures for determining how many clusters are present in data. It returns the number of clusters based on the maximum consensus. In case of ties, it will select the solution with fewer clusters.
n_clusters( x, standardize = TRUE, force = FALSE, package = c("NbClust", "mclust", "cluster", "M3C"), fast = TRUE, ... )
x |
A data frame. |
standardize |
Standardize the dataframe before clustering (default). |
force |
Logical, if |
package |
Package from which methods are to be called to determine the
number of clusters. Can be |
fast |
If |
... |
Arguments passed to or from other methods. |
There is also a plot()
-method implemented in the see-package.
library(parameters) if (require("mclust", quietly = TRUE) && require("NbClust", quietly = TRUE) && require("cluster", quietly = TRUE)) { n_clusters(iris[, 1:4], package = c("NbClust", "mclust", "cluster")) }
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.