R/wardKF.R

Defines functions wardKF

Documented in wardKF

#' Calculate the value of the Ward criterion function
#'
#' @description The function calculate the value of the Ward criterion function, based on a set of numerical variables and one categorical variable (partition).
#' @param X Data frame with values of numerical variables (usually the ones that were/are used for clustering).
#' @param clu Partition.
#' @return The value of the Ward criterion function.
#' @author Aleš Žiberna
#' @export

wardKF<-function(X, clu){
  sum(by(X,INDICES=clu,FUN=ssAllVar))
}

#' @rdname wardKF
#' @export
wardCF <- wardKF

Try the multiUS package in your browser

Any scripts or data that you put into this service are public.

multiUS documentation built on Jan. 23, 2023, 5:40 p.m.