cluster_points: Point clustering methods for spatial data with plotting...

View source: R/cluster_points.R

cluster_pointsR Documentation

Point clustering methods for spatial data with plotting functions

Description

Calculates cluster membership using DBScan

Usage

cluster_points(x, region, dist, minPts, verbose = T, plot = T, return_pts = T)

Arguments

x

an 'sf' point pattern. Should be the point pattern of interest.

region

an 'sf' polygon feature that defines the study region.

dist

a distance measure that defines the maximum neighborhood radius within points will be considered for cluster assignment.

minPts

The minimum number of points required within the dist measure for core points.

verbose

Should 'dbscan' results be printed? Defaults to TRUE.

plot

Should a plot be generated? Defaults to TRUE.

return_pts

Should the original x value be returned? Defaults to TRUE. The returned x value will contain a new column 'K' which contains integer identifiers for DBSCAN clusters, where 'K = 0' is a noise point, and 'K > 0 ' is a cluster ID.

Details

The 'cluster_points' function applies the Density-based Spatial Clustering of Applications with Noise (DBSCAN) algorithm. DBSCAN is a fast clustering method that distinguishes clusters of points from "noise" points based on a user-defined neighborhood distance and a minimum points threshold. The 'cluster_points' function simplifies the fitting and visualization of spatial point features. Users can return the original data with cluster IDs attached for further analysis.

#' @examples data("newhaven") data("nh_hom")

cluster_out <- cluster_points(x = nh_hom, region = newhaven, dist = 2000, minPts = 5)

References

Hahsler M, Piekenbrock M, Doran D (2019). dbscan: Fast Density-Based Clustering with R. Journal of Statistical Software, 91(1), 1-30. doi: 10.18637/jss.v091.i01


gmcirco/crimtools documentation built on May 22, 2022, 1:31 a.m.