Learn R Programming

spatialrisk (version 0.8.2)

mw_create: Create focal ("moving window") weight matrix

Description

Create a focal ("moving window") weight matrix for use in terra::focal().

Usage

mw_create(r, radius)

Arguments

r

SpatRaster.

radius

radius of the circle (in units of the crs).

Author

Martin Haringa

Details

The returned mask includes raster-cell centres whose Euclidean distance from the focal-cell centre is no greater than `radius` plus the full raster-cell diagonal. This conservative expansion accounts for the possible displacement of both a disk centre and a contributing point from their respective cell centres.