data(iris)
iris <- as.matrix(iris[,1:4])
kNNdistplot(iris, k=4)
## the knee is around a distance of .5
cl <- dbscan(iris, eps = .4, minPts = 4)
pairs(iris, col = cl+1L)
## Note: black are noise points
Run the code above in your browser using DataLab