calculate_dispersal_kernel | R Documentation |
Use a user defined function to create a 2D dispersal kernel.
calculate_dispersal_kernel(max_dispersal_dist, kfun, normalize = TRUE, ...)
max_dispersal_dist |
|
kfun |
|
normalize |
|
... |
additional parameters to be passed to the kernel function. |
Dispersal kernel with probabilities.
# 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
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.