mask_by_range: Mask a raster

View source: R/create_analysis_region.R

mask_by_rangeR Documentation

Mask a raster

Description

Create a raster mask based on an allowable range of values

Usage

mask_by_range(raster, range_mx)

Arguments

raster

A SpatRaster

range_mx

A matrix with one row for each layer of the raster to use when calculating mask, and a column each for "min" and "max", indicating min and max allowable values. Rownames must match layer names in raster.

Value

A SpatRaster mask: Values are NA where values fall outside the range and 1 where values fall within the range.


tabrasel/TerrainWorksUtils documentation built on June 1, 2025, 8:05 p.m.