cluster_flows_dbscan: Cluster Flows using DBSCAN

View source: R/clustering.R

cluster_flows_dbscanR Documentation

Cluster Flows using DBSCAN

Description

See dbscan for details on the DBSCAN algorithm.

Usage

cluster_flows_dbscan(dist_mat, w_vec, x, eps, minPts)

Arguments

dist_mat

distance matrix

w_vec

weight vector

x

flows tibble with flow_ID

eps

DBSCAN epsilon parameter

minPts

DBSCAN minPts parameter

Value

flows tibble with an additional cluster column

Examples

flows <- sf::st_transform(flows_leeds, 3857)
flows <- head(flows, 100) # for testing
# Add flow lengths and coordinates
flows <- add_flow_length(flows)
# filter by length
flows <- filter_by_length(flows, length_min = 5000, length_max = 12000)
flows <- add_xyuv(flows)
# Calculate distances
distances <- flow_distance(flows, alpha = 1.5, beta = 0.5)
dmat <- distance_matrix(distances)
wvec <- weight_vector(dmat, flows, weight_col = "count")
clustered <- cluster_flows_dbscan(dmat, wvec, flows, eps = 8, minPts = 70)

flowcluster documentation built on Aug. 21, 2025, 5:54 p.m.