R/kmeansz.R

kmeansz <-
function(x,n,G){
		kclus <- kmeans(x,G,nstart=50)$cluster
		zmat <- matrix(0,n,G)
		for(i in 1:n){
			zmat[i, kclus[i]]<-1
		}
	zmat
}

Try the mmtfa package in your browser

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

mmtfa documentation built on May 2, 2019, 1:45 p.m.