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)
}
epertham/xLLiM documentation built on Oct. 29, 2023, 6:16 a.m.