# K mean clustering method of data mining

How does the method calculate the mean between two coordination points? How does the method work with more than two dimensions? How can calculate the distance and the mean if there are more than two dimension?

Are there any packages about k-means clustering in R?

• kmeans() is built into R, the function "gets loaded" with the set of libraries R always loads at startup, so you don't have to import or install anything. – knb Jul 31 '17 at 8:08

$$d = |\mathbf{x}-\mathbf{y}|=\sqrt{\sum_{i=1}^n|x_i-y_i|^2}$$
Using kmeans() in R: