An implementation of K-Means algorithm in R