K-means clustering and DBSCAN Algorithm implementation in R