inst/examples/R/data/cluster/k_means/example_kmeans2.R

zfaithful <- apply(faithful, 2, scale)
# k-median
library("flexclust")
cl1 <- kcca(zfaithful, 2, family=kccaFamily('kmedians'))
plot(zfaithful, col=cl1@second)
cl1@centers
# k-medoid
library("cluster")
cl2 <- pam(zfaithful, 2)
plot(zfaithful, col=cl2$clustering)
cl2$medoids
sigbertklinke/shinyExample documentation built on May 26, 2019, 4:32 a.m.