kmeans_probs <- function(mat,m){
tmp <- apply(m,1,function(x){rowSums(sweep(mat,2,x,"-")^2)})
tmp <- tmp/rowSums(tmp)
return(tmp)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.