Skip to contents

Returns the order of the best partitions according to a certain criterion.

Usage

optimal_partitions(
  criterionValues,
  criterion,
  byName = TRUE,
  names = NULL,
  keepNA = TRUE
)

Arguments

criterionValues

Vector of numerical data indicating the criterion values for different partitions. (numeric vector)

criterion

Name of the clustering criterion. (character string)

byName

TRUE (default) if what should be returned is the names of partitions rather than their identifier. FALSE otherwise. The partition names can be specified via the names variable. If it's NULL, then the names of the criterionValues vector will be used. If none are available, byName is set to FALSE. (boolean)

names

Names of the partitions. Used when byName is TRUE, ignored otherwise. If used, it must be the same size as criterionValues. (vector or NULL)

keepNA

flag indicating if NA values should be kept in the result. If TRUE, they are kept at the end of the vector. If FALSE, they are removed.

Value

A vector of the same size as criterionValues, indicating the order (from best to worst) of partitions relative to the requested criterion. The indicated data are the identifiers of partitions if byName = FALSE, their names otherwise. (vector)