R/kmeans_probs.R

Defines functions kmeans_probs

kmeans_probs <- function(mat,m){
  tmp <- apply(m,1,function(x){rowSums(sweep(mat,2,x,"-")^2)})
  tmp <- tmp/rowSums(tmp)
  return(tmp)
}

Try the xLLiM package in your browser

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

xLLiM documentation built on Nov. 2, 2023, 5:17 p.m.