calculate_dispersal_kernel {metaRange} | R Documentation |
Calculate 2D dispersal kernel.
Description
Use a user defined function to create a 2D dispersal kernel.
Usage
calculate_dispersal_kernel(max_dispersal_dist, kfun, normalize = TRUE, ...)
Arguments
max_dispersal_dist |
|
kfun |
|
normalize |
|
... |
additional parameters to be passed to the kernel function. |
Value
Dispersal kernel with probabilities.
Examples
# a very simple uniform kernel
uniform_kernel <- calculate_dispersal_kernel(
max_dispersal_dist = 3,
kfun = function(x) {
x * 0 + 1
}
)
# same as
stopifnot(
uniform_kernel == matrix(1 / 49, nrow = 7, ncol = 7)
)
# now a negative exponential kernel
# not that `mean_dispersal_dist`
# is passed to the kernel function.
calculate_dispersal_kernel(
max_dispersal_dist = 3,
kfun = negative_exponential_function,
mean_dispersal_dist = 1
)
[Package metaRange version 1.1.4 Index]