
Classify landcover for SpatRaster object
Source:R/classify_landcover.R
classify_landcover.SpatRaster.RdPrepare for fitting SDMs by reclassifying an existing landscape raster according to the classifications used by a specific set of species distribution models (SDM).
Usage
# S3 method for class 'SpatRaster'
classify_landcover(x, SDM, coltab = TRUE, verbose = TRUE, ...)Details
This function is called by both create_predictor_stack() and
update_covertype() and is not generally intended to be called directly. It
calls on internal datasets to crosswalk from land cover classes listed in the
key to the predictors expected by the selected SDM group. The input raster
should already be encoded with the land cover classes listed in the key. To
help with creating such a raster, see classify_landcover.sf() to map land
cover polygons to the land cover classes in the key.
A warning is given if there are land cover classes present in the landscape that do not map to any of the predictors for the selected SDM group. This warnings may represent significant problems for fitting SDMs and should be carefully reviewed. It is recommended to review the corresponding internal datasets (predictors_riparian, predictors_waterbird_fall, predictors_waterbird_win, or predictors_tima) for the list of expected predictors and how they map to land cover classes in the key. Check whether the selected SDM group expects more specific land cover classes or subclasses; the input raster may need to be reclassified before proceeding.
Examples
r <- terra::rast(matrix(sample(c(11,19,71,72,90), size = 100, replace = TRUE),
ncol = 10, nrow = 10))
r <- suppressWarnings(classify_landcover(r, SDM = 'riparian'))