CASA0005repo
CASA0005repo copied to clipboard
DBSCAN code
Updated from MSc student
I wrote a bit of code for creating convex hulls for the dbscan output, which are a bit more nicely shaped than those in the practical, maybe someone will find it useful :slightly_smiling_face: convex hulls to wrap around points
chulls <- data.frame() for (cluster in 1:max(BluePlaquesSubPoints$dbcluster)) { cluster_data <- BluePlaquesSubPoints %>% filter(dbcluster == cluster) ch <- chull(cluster_data$coords.x1, cluster_data$coords.x2) chulls <- chulls %>% bind_rows(cluster_data[c(ch), ]) }