I want to group a list of Long and Lats (my_long_lats) based on pre determined center points (my_center_Points).
When I run:-
k <- kmeans(as.matrix(my_long_lats), centers = as.matrix(my_center_Points))
k$centers
does not equal my_center_Points.
I assume k-means has adjusted my center points to the optimal center. But what I need is for my_center_Points to not change and group my_long_lats around them.
In this link they talk about setting initial centers but How do I set centers that wont change once I run the k means? Or is there a better clustering algorithm for this?
I could even settle for minimizing the movement of the centers.
I still have a lot to learn in R, any help is really appreciated.