if I have this
x = c(0.5,0.1,0.3,6,5,2,1,4,2,1,0.9,3,6,99,22,11,44,55)
apply kmeans
kmeans(x, centers=5, iter.max = 10, nstart = 1)
this gives:
Cluster means:
[,1]
1 99.00
2 49.50
3 22.00
4 7.00
5 1.48
Clustering vector:
[1] 5 5 5 4 4 5 5 5 5 5 5 5 4 1 3 4 2 2
Now I want to classify my values in x2 based on the clusters of x (1,2,3,4,5). How to do this?
x2 = c(0.3,1,3,0.66,0.5,0.2,0.1,64,92,21,0.93,93,6,99,22,11,44,55)