Runs a DTSCAN-style clustering pipeline using a Delaunay triangulation of point coordinates, global pruning based on z-scored triangle areas and edge lengths, and MinPts graph expansion. Returns only the cluster labels vector aligned to the input rows.
Arguments
- x
An
sfobject with POINT geometry.- min_pts
Minimum neighbour count for a point to be treated as a core point. Neighbours are the sites directly connected by kept Delaunay edges after pruning. If multiple input points share exactly the same coordinates, they are collapsed to one site and their multiplicity contributes to this count.
- area_z_min
Threshold (in SD units) on the inverse z-score of triangle areas used for pruning. Larger thresholds keep only progressively smaller-than-average triangles and prune more edges. Default to 0.
- length_z_min
Threshold (in SD units) on the inverse z-score of Delaunay edge lengths used for pruning. Larger thresholds keep only progressively shorter-than-average edges and prune more connections.
- id_col
Optional character scalar naming a unique identifier column in
xused to align output. IfNULLor missing fromx, output is aligned by current row order.
Value
An integer vector of cluster labels of length nrow(x).
0 indicates noise/unassigned; positive integers are cluster ids.
Details
Identical coordinates are collapsed before triangulation; their multiplicity contributes
to MinPts via effective_degree = degree + (mult - 1).
Cluster labels are produced by starting a new cluster at each unassigned core site
(a site meeting the MinPts rule) and iteratively visiting all sites reachable through
pruned Delaunay edges from that seed; the cluster id is assigned to every visited site.