Convert a terra::rast()
object containing
integer/categorical values into a raster
object where each layer corresponds to a different integer/categorical
value and pixel values denote the presence/absence of the given
integer/categorical values.
Usage
binary_stack(x)
# S3 method for Raster
binary_stack(x)
# S3 method for SpatRaster
binary_stack(x)
Arguments
- x
terra::rast()
object with a single layer.
Value
A terra::rast()
object.
Details
This function is provided to help manage data that encompass
multiple management zones. For instance, this function may be helpful
for preparing raster data for add_locked_in_constraints()
and
add_locked_out_constraints()
since they require binary
rasters as input arguments.
It is essentially a wrapper for terra::segregate()
.