R/fitted.clusmca.R

Defines functions fitted.clusmca

Documented in fitted.clusmca

fitted.clusmca <- function(object, mth = c("centers", "classes"), ...) 
{
  mth <- match.arg(mth)
  # object$centroid = data.frame(object$centroid)
  if (mth == "centers") 
    if (object$centroid != 0) {
      object$centroid[object$cluster, , drop = FALSE]
    } else {
      object$centroid[object$cluster]
    }
  else {
    if (object$centroid != 0) {
      object$cluster 
    } else {
      object$centroid[object$cluster]
    }
  }
}

Try the clustrd package in your browser

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

clustrd documentation built on July 17, 2022, 1:05 a.m.