Clustering in R

help(kmeans) set.seed(1) x=matrix(rnorm(50*2), ncol=2) plot(x) x[1:25,1]=x[1:25,1]+3 x[1:25,2]=x[1:25,2]-4 plot(x) km.out=kmeans(x,2,nstart=20) km.out K-means clustering with 2 clusters of sizes 25, 25 Cluster means: [,1] [,2] 1 0.03223135 0.06924384 2 3.16866521 -3.83459093 Clustering vector: [1] 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 … More Clustering in R