How to partition a area using k-mean in r?

Viewed 62

I have this exemple of clustering data

library(cluster)
library(fpc)

input = data.frame(Lon = c(43,43.2,43.5,43.8,44), Lat = c(-12,-11.5,-13,-14,-10.5), Var = c(5,4,7,8,8))

clus <- kmeans(input, centers = 3)

plotcluster(input, clus$cluster)

r <- clusplot(input, clus$cluster, color = T, shade = T, labels = 2, lines = 0)

I want to draw red lines who partition points like show the exemple below.

enter image description here

0 Answers
Related