k-Nearest Neighbor Join for Spatial Data
Overview
K-nearest neighbor search for projected and non-projected 'sf' spatial layers. Nearest neighbor search uses (1) C code from 'GeographicLib' for lon-lat point layers, (2) function knn() from package 'nabor' for projected point layers, or (3) function st_distance() from package 'sf' for line or polygon layers. The package also includes several other utility functions for spatial analysis.
- Fixed error when using CRS where units can't be accessed through 'sf'
From NEWS.md in the release
Install
Health
- OK13 OK2026-08-05
- NOTE12 OK, 1 NOTE2026-08-01
- OK14 OK2026-03-10
Documentation
- Help pages
- 13 (1 internal)includes a package overview page
- Examples that run
- 92%11 run in a plain check · 1 never run
- Exported functions with examples
- 100%
- Documented parameters
- 100%
- Return-value docs
- 100%
- Help pages citing references
- 46%
Downloads
Repository
- PRs merged (all time)
- 100%
- Median days to close, 50 most recently updated closed issues
- 2
- Median days to close, 50 most recently updated closed PRs
- 0
Stars over time
Forks over time
Issues over time
PRs over time
5 development-tooling and community-health practices detected across 2 families in the upstream repository
Checks run against github.com/michaeldorman/nngeo on 2026-10-21.
Dependencies
Installing nngeo adds 13 packages (11 with compiled code, 38 MB of source tarballs). Heaviest: BH 14 MB, sf 9.3 MB, data.table 5.7 MB.
Code & Tests
Datasets
People & History
Pick two releases to compare their code metrics.
- RR 4.6.0 released · 2026-04-24
- RR 4.5.0 released · 2025-04-11
- RR 4.4.0 released · 2024-04-24
- 0.4.8Latest
- 0.4.72023-04-24 · diff ↗
- RR 4.3.0 released · 2023-04-21
- 0.4.62022-05-29 · diff ↗
- RR 4.2.0 released · 2022-04-22
- 0.4.52022-01-13 · diff ↗
- 0.4.42021-09-06 · diff ↗
- 0.4.32021-06-13 · diff ↗
- RR 4.1.0 released · 2021-05-18
- 0.4.22021-03-15 · diff ↗
- 0.4.1
- 0.4.02020-10-18 · diff ↗
- 0.3.92020-08-11 · diff ↗
Show 18 earlier eventsHide 18 earlier events
- 0.3.82020-06-10 · diff ↗
- RR 4.0.0 released · 2020-04-24
- 0.3.7
- 0.3.42020-02-03 · diff ↗ ·
removed 7 exports
raster_aspect, raster_clump, raster_extend, raster_extract, raster_focal, raster_slope, raster_trimadded 2 exports
focal2, st_split_junctions - 0.3.0
- 0.2.92019-08-07 · diff ↗ ·
added 6 exports
raster_aspect, raster_clump, raster_extract, raster_focal, raster_slope, raster_trim - 0.2.82019-05-12 · diff ↗
- RR 3.6.0 released · 2019-04-26
- 0.2.7
- 0.2.4
- 0.2.22018-09-29 · diff ↗
- 0.2.12018-07-21 · diff ↗
- 0.2.02018-07-18 · diff ↗
- 0.1.82018-05-15 · diff ↗
- RR 3.5.0 released · 2018-04-23
- 0.1.52018-03-16 · diff ↗
- 0.1.02018-01-16
- RR 3.4.0 released · 2017-04-21
Package metadata
- First published
- 2018-01-16
- Total releases
- 24 / 8 yrs
- License
- MIT + file LICENSE OSI
- Minimum R
- ≥ 3.5.0
- Bundled data
- 54 KB / 5 files
- Download size
- 469 KB
Cite
Cite this package
Run in R for the authors' preferred citation:
citation("nngeo")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-24, which the citation names so these numbers can be found later. More on citing and the projects behind them.