R/fitted.cluspcamix.R

fitted.cluspcamix <- function(object, mth = c("centers", "classes"), ...) 
{
  mth <- match.arg(mth)
  
  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 May 8, 2019, 5:03 p.m.