Transfer (food, contaminant) across trophic levels
transfer.RdComputes the transfer through a trophic network from lower to higher trophic levels using spatial spreading and intake functions.
Usage
transfer(
spacemodel,
kernels,
intakes = NULL,
exposure_weighting = "local",
verbose = FALSE
)Arguments
- spacemodel
A named list of spatial layers (e.g.
SpatRasterobjects). Must contain an attributetrophic_tblof classtrophic_tbl.- kernels
A list of kernel parameters for each layer.
- intakes
A
trophic_tblobject (or compatible table) containing normalized weights and flux functions for each trophic link.- exposure_weighting
Character. Defines how the realized exposure is calculated based on the predator's presence. Options are:
"local"(Default): Weight exposure by the local habitat value (`predator_habitat`). Assumes the predator's intake is strictly proportional to the habitat quality/density of the pixel where it resides."diffuse": Weight exposure by a dispersed habitat kernel. Represents a "neighborhood" effect where the predator's presence is smoothed over its home range. Useful to avoid edge effects where a predator on a poor pixel surrounded by good habitat would otherwise have 0 exposure."potential": No weighting. Returns the pure environmental offer (potential exposure) regardless of the predator's density. Useful for identifying risk hotspots.
- verbose
Logical. If
TRUE, prints progress information.
Details
The function processes layers in ascending trophic order, as defined
by the level attribute of the trophic table.
For each layer:
Resources (lower neighbors) are identified.
Concentration from each resource is spatially spread using
spread().Intake is computed using
intake().Contributions from all resources are summed.
The function assumes that intake weights are already normalized so that, for each consumer, the sum of contributions from all resources equals 1.