update k-means clustering R script