Fit previously-developed species distribution models for riparian landbird species, waterbird groups during the fall or winter, or tidal marsh bird species to a new set of predictors, such as those derived from a new scenario of landscape change.
Usage
fit_SDM(
pathin,
SDM,
landscape_name,
modlist,
constants = NULL,
factors = NULL,
landscape = NULL,
unsuitable = NULL,
pathout,
overwrite = FALSE
)Arguments
- pathin, SDM, landscape_name
Character strings defining the filepath (
pathin/SDM/landscape_name) containing new predictor rasters to include in the model, such as those created from runningpython_focal_finalize()- modlist
List of model objects of class 'gbm' representing the distribution models to which new predictors should be fit.
- constants
optional dataframe containing predictors with a constant value that should be applied to all pixels. See Details.
- factors
optinal list of named lists defining categorical predictors included in distribution models. See Details.
- landscape
optional SpatRaster corresponding to the landscape represented by the predictors contained in
pathin/landscape_name, used to identify the locations ofunsuitableland covers. Must be provided ifunsuitableis notNULL.- unsuitable
optional vector of numerical values representing the land cover classifications that should be considered unsuitable a priori. If not
NULL,landscapemust also be provided.- pathout
Character string defining the filepath (
pathout/SDM/landscape_name) where output rasters should be written- overwrite
Logical; passed to
terra::writeRaster()
Details
This function is designed to fit multiple distribution models to the
same set of predictors describing a given landscape. New predictors must
first be created and named to match the predictors included in the original
models, e.g. using python_focal_prep(), python_focal_run(), and
python_focal_finalize().
constants are passed to terra::predict() and provide a way to include
constant values for one or more predictors that should be applied to all
pixels. For both riparian and waterbird models, this will include a
predictor representing effort ('area.ha' for riparian landbirds and
'offset' for waterbirds). For riparian landbird models applied only to the
Delta, constants should also include a region predictor used as a
categorical predictor representing the Sacramento Valley (0) or the Delta
or San Joaquin Valley (1). None needed for tidal marsh birds. (See
vignette)
factors are also passed to terra::predict() and provide a way to define
categorical predictors. For waterbird and tidal marsh bird models, this is
necessary to define the 'covertype' and 'LANDCOVER' predictors,
respectively. (See vignette)
unsuitable land covers will be presumed to have a predicted value of
zero. The locations of unsuitable landcovers will be extracted from
landscape, assigned a value of zero, and overlaid on the model
predictions.
