
Last chance! 50% off unlimited learning
Sale ends in
This function runs many existing procedures for determining how many clusters are present in your data. It returns the number of clusters based on the maximum consensus. In case of ties, it will select the solution with the less clusters.
n_clusters(x, standardize = TRUE, force = FALSE,
package = c("NbClust", "mclust", "clValid", "cluster"), fast = TRUE,
...)
A data frame.
Standardize the dataframe before clustering (default).
Logical, if TRUE
, factors are converted to numerical
values in order to be included in the data for determining the number of
clusters. By default, factors are removed, because most methods that determine
the number of clusters need numeric input only.
These are the packages from which methods are used to determine the number of clusters. Can be "all"
or a vector containing "NbClust"
, "mclust"
, "clValid"
and "cluster"
.
If FALSE
, will compute 4 more indices (sets index = "allong"
in NbClust
). This has been deactivated by default as it is computationaly heavy.
Arguments passed to or from other methods.
# NOT RUN {
library(parameters)
# }
# NOT RUN {
n_clusters(iris[, 1:4])
# }
Run the code above in your browser using DataLab