Kmeans is the process of assigning objects to groups so that the sum of the squares of the groups is minimized. R has the kmeans
function available for cluster analysis. Kmeans is a method of determining clusters based on partitioning the data and assigning items in the dataset to the nearest cluster.
Kmeans clustering is done in R using the kmeans
function. The kmeans
function is defined as follows:
kmeans(x, centers, iter.max = 10, nstart = 1, algorithm = c("HartiganWong", "Lloyd", "Forgy","MacQueen"), trace=FALSE)
The various parameters of this function are described in the following table:
Parameter 
Description 


This is the dataset. 

This contains the number of centers/clusters to find. 

This ... 
No credit card required