threshold_raster: Threshold raster

View source: R/threshold_raster.R

threshold_rasterR Documentation

Threshold raster

Description

Threshold raster.

Usage

threshold_raster(rast, threshold, value = 0, outfile)

Arguments

rast

A file path to a raster file.

threshold

A named list giving the minimum and/or maximum values defining the range of values to retain. Values outside this range will be replaced with value. Can be list(min = Y, max = Z) or list(min = Y) or list(max = Z).

value

Numeric. The value supplied to cells beyond the threshold(s).

outfile

Character. Output raster file path. Parent directory will be created recursively if required. If outfile is not provided, the resulting RasterLayer will be returned to R.

Value

A RasterLayer will be written to outfile if provided, and returned to R otherwise.


jscamac/edmaps documentation built on June 11, 2022, 1:26 a.m.