Skip to content

spatialrisk

Spatial Concentration and Radius-Based Risk Calculations

v0.8.1 · Jun 16, 2026 · GPL (>= 2)

Description

Provides methods for spatial concentration and radius-based risk calculations. The package focuses on efficient determination of the sum of observations within a given radius, identifying areas of high local concentration, and aggregating point data to polygon geometries. These methods are useful for applications such as insurance, urban analytics, environmental exposure analysis, and other spatial point pattern workflows. The underlying maximum covering problem is described by Church (1974) <doi:10.1007/BF01942293>.

Downloads

CRAN

866

Last 30 days

3931st

2.1K

Last 90 days

9.9K

Last year

Trend: +71.2% (30d vs prior 30d)

r2u CRAN

55

Last 30 days

275

Last 90 days

780

Last year

Trend: -32.9% (30d vs prior 30d)

autoCRAN

6

Last 7 days

20

Last 30 days

0

All-time

autoCRAN-only: this name is served only by autoCRAN, so the count is exact.

CRAN Check Status

13 OK
Show all 13 flavors
Flavor Status
r-devel-linux-x86_64-debian-clang OK
r-devel-linux-x86_64-debian-gcc OK
r-devel-linux-x86_64-fedora-clang OK
r-devel-linux-x86_64-fedora-gcc OK
r-devel-windows-x86_64 OK
r-oldrel-macos-arm64 OK
r-oldrel-macos-x86_64 OK
r-oldrel-windows-x86_64 OK
r-patched-linux-x86_64 OK
r-release-linux-x86_64 OK
r-release-macos-arm64 OK
r-release-macos-x86_64 OK
r-release-windows-x86_64 OK

Check History

OK 13 OK · 0 NOTE · 0 WARNING · 0 ERROR · 0 FAILURE Jun 9, 2026
ERROR 12 OK · 0 NOTE · 0 WARNING · 1 ERROR · 0 FAILURE Jun 8, 2026
ERROR r-devel-linux-x86_64-debian-gcc

examples

Running examples in ‘spatialrisk-Ex.R’ failed
The error most likely occurred in:

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: choropleth
> ### Title: Create choropleth map
> ### Aliases: choropleth
> 
> ### ** Examples
> 
> 
...[truncated]...
t <- summarise_points_by_polygon(nl_provincie, insurance, "amount")
109 points are outside any polygon.
> choropleth(test, value = "amount_sum")
Error: tmap is needed for this function to work. Install it via install.packages("tmap")
Execution halted
OK 13 OK · 0 NOTE · 0 WARNING · 0 ERROR · 0 FAILURE May 10, 2026
ERROR 10 OK · 3 NOTE · 0 WARNING · 1 ERROR · 0 FAILURE Apr 18, 2026
ERROR r-devel-windows-x86_64

whether package can be installed

Installation failed.
See 'd:/Rcompile/CRANpkg/local/4.6/spatialrisk.Rcheck/00install.out' for details.
NOTE r-oldrel-macos-arm64

installed package size

installed size is  6.0Mb
  sub-directories of 1Mb or more:
    data   2.6Mb
    help   1.4Mb
    libs   1.9Mb
NOTE r-oldrel-macos-x86_64

installed package size

installed size is  5.9Mb
  sub-directories of 1Mb or more:
    data   2.6Mb
    help   1.4Mb
    libs   1.7Mb
NOTE r-oldrel-windows-x86_64

installed package size

installed size is  5.1Mb
  sub-directories of 1Mb or more:
    data   2.5Mb
    help   1.4Mb
    libs   1.0Mb
NOTE 11 OK · 3 NOTE · 0 WARNING · 0 ERROR · 0 FAILURE Apr 10, 2026
NOTE r-oldrel-macos-arm64

installed package size

installed size is  6.0Mb
  sub-directories of 1Mb or more:
    data   2.6Mb
    help   1.4Mb
    libs   1.9Mb
NOTE r-oldrel-macos-x86_64

installed package size

installed size is  5.9Mb
  sub-directories of 1Mb or more:
    data   2.6Mb
    help   1.4Mb
    libs   1.7Mb
NOTE r-oldrel-windows-x86_64

installed package size

installed size is  5.1Mb
  sub-directories of 1Mb or more:
    data   2.5Mb
    help   1.4Mb
    libs   1.0Mb
ERROR 10 OK · 3 NOTE · 0 WARNING · 1 ERROR · 0 FAILURE Apr 9, 2026
ERROR r-devel-linux-x86_64-debian-gcc

whether package can be installed

Installation failed.
See ‘/home/hornik/tmp/R.check/r-devel-gcc/Work/PKGS/spatialrisk.Rcheck/00install.out’ for details.
NOTE r-oldrel-macos-arm64

installed package size

installed size is  6.0Mb
  sub-directories of 1Mb or more:
    data   2.6Mb
    help   1.4Mb
    libs   1.9Mb
NOTE r-oldrel-macos-x86_64

installed package size

installed size is  5.9Mb
  sub-directories of 1Mb or more:
    data   2.6Mb
    help   1.4Mb
    libs   1.7Mb
NOTE r-oldrel-windows-x86_64

installed package size

installed size is  5.1Mb
  sub-directories of 1Mb or more:
    data   2.5Mb
    help   1.4Mb
    libs   1.0Mb
NOTE 11 OK · 3 NOTE · 0 WARNING · 0 ERROR · 0 FAILURE Mar 10, 2026
NOTE r-oldrel-macos-arm64

installed package size

installed size is  6.0Mb
  sub-directories of 1Mb or more:
    data   2.6Mb
    help   1.4Mb
    libs   1.9Mb
NOTE r-oldrel-macos-x86_64

installed package size

installed size is  5.9Mb
  sub-directories of 1Mb or more:
    data   2.6Mb
    help   1.4Mb
    libs   1.7Mb
NOTE r-oldrel-windows-x86_64

installed package size

installed size is  5.1Mb
  sub-directories of 1Mb or more:
    data   2.5Mb
    help   1.4Mb
    libs   1.0Mb

Code intelligence has not been computed for this package yet.

Code

Structure

Lines of code

10,140

Files

114

Compiled share

20.8%

Has compiled src

Yes

Language breakdown

R 4,521 (44.6%)C/C++/src 2,105 (20.8%)Tests 1,191 (11.7%)Docs 1,944 (19.2%)Vignettes 379 (3.7%)

API

Exported functions

21

Internal functions

94

Recent export changes

v0.8.1+3 optimize_hotspot, prepare_spatialrisk, select_candidates
v0.8.0+5 concentration_hotspot, map_points, points_within_radius +2 more  −1 points_in_circle_vec

Testing & CI

Has tests

Yes

Test-to-code ratio

0.26

testthat edition

CI present

No

CI type

[]

PR gated

No

Docs

Return-value doc rate

100%

\dontrun example ratio

40%

Roxygen coverage

100%

Has pkgdown

No

NEWS present

Yes

Health & Security signals

Informational signals; not verdicts.

on.exit coverage

100%

Unsafe pattern score

0

Dep constraint coverage

0%

Secret pattern count

0

Bundled 3rd-party code

2 items

Portability & License

Min R version

4.1.0

System requirements

C++ standard

License

GPL (>= 2)

License flags

SPDX valid, OSI approved

History

Versions

20

First release

2018-09-03

Latest release

2026-06-16

Avg cadence

81 days

Cold removal rate

100%

Dep drift

50

LOC over versions

v0.2.1: 521 LOCv0.3.1: 580 LOCv0.4.1: 609 LOCv0.5.1: 612 LOCv0.6.0: 1,256 LOCv0.6.1: 1,277 LOCv0.6.2: 1,289 LOCv0.6.3: 1,443 LOCv0.6.4: 1,687 LOCv0.6.5: 1,897 LOCv0.6.6: 1,971 LOCv0.6.7: 2,061 LOCv0.6.8: 2,944 LOCv0.6.9: 3,278 LOCv0.7.0: 3,955 LOCv0.7.1: 3,443 LOCv0.7.2: 4,965 LOCv0.7.3: 5,103 LOCv0.8.0: 9,146 LOCv0.8.1: 10,140 LOC

Per-file churn detail lives in the source pipeline: https://github.com/r-observatory/cran-code-metrics.

Dependency Network

Dependencies Reverse dependencies data.table dplyr fs lifecycle Rcpp RcppProgress rlang sf terra units spatialrisk

Version History

21 tracked
updated 0.8.1 ← 0.8.0 diff Jun 16, 2026
updated 0.8.0 ← 0.7.3 diff May 4, 2026
new 0.7.3 Mar 10, 2026
updated 0.7.3 ← 0.7.2 diff Sep 13, 2025
updated 0.7.2 ← 0.7.1 diff May 24, 2025
updated 0.7.1 ← 0.7.0 diff Feb 20, 2024
updated 0.7.0 ← 0.6.9 diff Nov 9, 2021
updated 0.6.9 ← 0.6.8 diff May 25, 2021
updated 0.6.8 ← 0.6.7 diff May 17, 2021
updated 0.6.7 ← 0.6.6 diff Apr 22, 2020
updated 0.6.6 ← 0.6.5 diff Mar 20, 2020
updated 0.6.5 ← 0.6.4 diff Nov 5, 2019
updated 0.6.4 ← 0.6.3 diff Oct 24, 2019
updated 0.6.3 ← 0.6.2 diff Oct 18, 2019
updated 0.6.2 ← 0.6.1 diff Jul 28, 2019