Disperse a species or variable over the landscape
dispersal.RdApplies a dispersal mechanism to a specific layer of the `spacemodel` object.
This function acts as a wrapper around compute_dispersal to handle
the `spacemodel` class structure.
Usage
dispersal(
spacemodel,
layer = 1,
method = "convolution",
method_option = list()
)Arguments
- spacemodel
A
spacemodelobject.- layer
Character or Integer. The name or index of the layer to disperse (e.g., "Fox", 1).
- method
Character. The dispersal method to use. Options are:
"convolution"(default): Uses a moving window (kernel)."omniscape": Uses Circuit Theory (via Julia and Omniscape.jl).
- method_option
A list of parameters specific to the chosen method:
For
"convolution": must containkernel(a matrix).For
"omniscape": must containresistance(SpatRaster) andradius(numeric).
Examples
if (FALSE) { # \dontrun{
# 1. Convolution example
my_kernel <- matrix(1, nrow=3, ncol=3)
sm_updated <- dispersal(sm, layer = "Predator", method = "convolution",
method_option = list(kernel = my_kernel))
# 2. Omniscape example (requires Julia)
sm_updated <- dispersal(sm, layer = "Predator", method = "omniscape",
method_option = list(resistance = res_map, radius = 10))
} # }