I have this simple data.frame
data.frame
lat<-c(1,2,3,10,11,12,20,21,22,23) lon<-c(5,6,7,30,31,32,50,51,52,53) data=data.frame(lat,lon)
What about something like this:
lat<-c(1,2,3,10,11,12,20,21,22,23) lon<-c(5,6,7,30,31,32,50,51,52,53) km <- kmeans(cbind(lat, lon), centers = 3) plot(lon, lat, col = km$cluster, pch = 20)