### Helper function
test <- function(db, eps) {
print(cl <- clustlearn::dbscan(db, eps))
out <- cl$cluster == 0
plot(db[!out, ], col = cl$cluster[!out], pch = 20, asp = 1)
points(db[out, ], col = max(cl$cluster) + 1, pch = 4, lwd = 2)
}
### Example 1
test(clustlearn::db1, 0.3)
### Example 2
test(clustlearn::db2, 0.3)
### Example 3
test(clustlearn::db3, 0.25)
### Example 4
test(clustlearn::db4, 0.2)
### Example 5
test(clustlearn::db5, 0.3)
### Example 6
test(clustlearn::db6, 0.3)
### Example 7 (with explanations, no plots)
cl <- clustlearn::dbscan(
clustlearn::db5[1:20, ],
0.3,
details = TRUE,
waiting = FALSE
)
Run the code above in your browser using DataLab