R/Kmeans.R

Kmeans <-
function(x,k,xout=FALSE,outfun=out){
#
# Do K means cluster analysis, outliers removed
#  if xout=T
x=elimna(x)
x=as.matrix(x)
if(xout){
flag<-outfun(x,plotit=FALSE)$keep
x<-x[flag,]
}
x=as.matrix(x)
res=kmeans(x,k)
res
}
musto101/wilcox_R documentation built on May 23, 2019, 10:52 a.m.