Cluster Origin-Destination Flow Data
Overview
Provides functionality for clustering origin-destination (OD) pairs, representing desire lines (or flows). This includes creating distance matrices between OD pairs and passing distance matrices to a clustering algorithm. See the academic paper Tao and Thill (2016) doi:10.1111/gean.12100 for more details on spatial clustering of flows. See the paper on delineating demand-responsive operating areas by Mahfouz et al. (2025) doi:10.1016/j.urbmob.2025.100135 for an example of how this package can be used to cluster flows for applied transportation research.
- Fixed the CRAN check issue addressed in PR #35 by correcting the clustering validation logic for
MinPts.
From NEWS.md in the release
Install
Health
ERRORtestsr-patched-linux-x86_64
Running ‘testthat.R’ [13s/16s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
> # This file is part of the standard setup for testthat.
> # It is recommended that you do not modify it.
> #
> # Where should you do additional test configuration?
> # Learn more about the roles of various files in:
> # * https://r-pkgs.org/tests.html
> # * https://testthat.r-lib.org/reference/test_package.html#special-files
>
> library(testthat)
> library(flowcluster)
>
> test_check("flowcluster")
Attaching package: 'dplyr'
The following objects are masked from 'package:stats':
filter, lag
The following objects are masked from 'package:base':
intersect, setdiff, setequal, union
Linking to GEOS 3.15.0, GDAL 3.13.3, PROJ 9.9.0; sf_use_s2() is TRUE
Flows remaining after filtering: 328 (32.8%)
Extracting start and end coordinates from flow geometries...
Adding x, y, u, v columns to flow data...
Assigning unique flow IDs..
...[truncated]...
ng: 23 (11.5%)
Extracting start and end coordinates from flow geometries...
Adding x, y, u, v columns to flow data...
Assigning unique flow IDs...
Flows remaining after filtering: 10 (10%)
Extracting start and end coordinates from flow geometries...
Adding x, y, u, v columns to flow data...
Assigning unique flow IDs...
[ FAIL 1 | WARN 84 | SKIP 0 | PASS 63 ]
══ Failed tests ════════════════════════════════════════════════════════════════
── Error ('test-clustering.R:66:3'): dbscan_sensitivity: runs without error ────
Error: minPts must be a single, finite, integer-valued number >= 1.
Backtrace:
▆
1. └─flowcluster::dbscan_sensitivity(...) at test-clustering.R:66:3
2. └─flowcluster::cluster_flows_dbscan(...)
3. └─dbscan::dbscan(x = dist_mat, eps = eps, minPts = minPts, weights = w_vec)
4. └─dbscan:::.validate_integer_scalar(minPts, "minPts")
[ FAIL 1 | WARN 84 | SKIP 0 | PASS 63 ]
Error:
! Test failures.
Execution halted- ERROR12 OK, 1 ERRORNow
- ERROR11 OK, 2 ERROR2026-10-05
- OK13 OK2026-08-05
- NOTE12 OK, 1 NOTE2026-08-01
- OK14 OK2026-03-10
Documentation
- Help pages
- 11 (1 internal)
- Examples that run
- 100%9 run in a plain check
- Exported functions with examples
- 100%
- Documented parameters
- 100%
- Return-value docs
- 100%
- Help pages citing references
- 9%
Downloads
Repository
- PRs merged (all time)
- 100%
- Median days to close, 50 most recently updated closed issues
- 3
- Median days to close, 50 most recently updated closed PRs
- 0
Stars over time
Forks over time
Releases over time
Issues over time
PRs over time
Commits over time
Commit identities over time
10 development-tooling and community-health practices detected across 6 families in the upstream repository
Checks run against github.com/hussein-mahfouz/flowcluster on 2026-10-18.
The R CMD check workflow runs on Linux, macOS and Windows, and on R-devel
GitHub Pages site last deployed 2026-10-13 · The repository has a site deploy workflow
pkgdown site last built 2026-10-13
Show all practicesHide 2 practices
Dependencies
Code & Tests
Datasets
People & History
Package metadata
- First published
- 2025-07-05
- Total releases
- 3 / 1 yrs
- License
- MIT + file LICENSE OSI
- Minimum R
- ≥ 4.1.0
- Bundled data
- 49 KB / 1 file
- Download size
- 1.9 MB
Cite
Cite this package
Run in R for the authors' preferred citation:
citation("flowcluster")This package has no citation file, so citation() returns this entry built from DESCRIPTION.
Cite the R Observatory
For a number measured here: a download total, a coverage figure, an archival date.
From data release v2026-10-21, which the citation names so these numbers can be found later. More on citing and the projects behind them.