Learn R Programming

⚠️There's a newer version (0.8.3) of this package.Take me there.

spatialrisk (version 0.7.3)

Calculating Spatial Risk

Description

Provides methods for spatial risk calculations, focusing on efficient determination of the sum of observations within a circle of a given radius. These methods are particularly relevant for applications such as insurance, where recent European Commission regulations require the calculation of the maximum insured value of fire risk policies for all buildings that are partly or fully located within a 200 m radius. The underlying problem is described by Church (1974) .

Copy Link

Version

Install

install.packages('spatialrisk')

Monthly Downloads

471

Version

0.7.3

License

GPL (>= 2)

Issues

Pull Requests

Stars

Forks

Maintainer

Martin Haringa

Last Published

September 14th, 2025

Functions in spatialrisk (0.7.3)

knmi_historic_data

Retrieve historic weather data for the Netherlands
highest_conc

Find the highest concentration for the current iteration
neighborhood_gh_search

Search for coordinates with higher concentrations within geohash
knmi_stations

KNMI stations
interpolate_spline

Splines on the sphere
highest_concentration

Highest concentration risk
insurance

Sum insured per postal code in the Netherlands
nl_corop

Object of class sf for COROP regions in the Netherlands
mw_create

Create focal ("moving window") weight matrix
map_points_to_cells

Map point coordinates to cell indices
nl_postcode4

Object of class sf for 4-digit postcode regions in the Netherlands
nl_postcode3

Object of class sf for 3-digit postcode regions in the Netherlands
nl_gemeente

Object of class sf for municipalities in the Netherlands
points_in_circle

Find points within a circle around a center coordinate
plot_points

Create interactive point map
plot.conc

Automatically create a plot for objects obtained from highest_concentration()
plot.concentration

Automatically create a plot for objects obtained from find_highest_concentration()
nl_provincie

Object of class sf for provinces in the Netherlands
plot.neighborhood

Automatically create a plot for objects obtained from neighborhood_gh_search()
nl_postcode2

Object of class sf for 2-digit postcode regions in the Netherlands
update_focal

Update current focal for the next iteration
points_to_polygon

Map points to polygons
update_rasterize

Update current rasterize for the next iteration
update_db

Save highest concentrations per cell for subsequent iterations
top_n_focals

Identify the focal indices with the highest values
points_in_circle_vec

Filter observations within circle (vectorized)
Groningen

Coordinates of houses in Groningen
concentration

Concentration calculation
choropleth

Create choropleth map
find_highest_concentration

Find highest concentration
convert_crs_df

Convert Coordinate Reference System (CRS)
choropleth_ggplot2

Choropleth map of an sf object with ggplot2
haversine

Haversine great circle distance
convert_df_to_sf

Convert data.frame to simple features (sf) object
cells_above_threshold

Identify the focal cells exceeding the threshold
conc_per_cell_new

Determine the concentrations within the highest focal cells for the current iteration