Description Usage Arguments Details Value Examples
Calculate number of individuals dispersing from patch i to j
1 2 3 4 5 6 7 8 9 | dispersal_n(
N,
v_p_dispersal,
v_theta,
dist_mat,
m_b_dispersal,
m_c_dispersal,
m_p_dispersal
)
|
N |
Abundance matrix with |
v_p_dispersal |
A vector of dispersal probabilities of length = 3. in |
v_theta |
Vector of length = 3, Parameters controlling the distance decay function. Larger values of theta result in a faster decline of dispersal distance. |
dist_mat |
a distance matrix with |
m_b_dispersal |
dispersal matrix for species B. This and the following 2 matrices are calculated internally in |
m_c_dispersal |
dispersal matrix for species C. |
m_p_dispersaldispersal |
matrix for species P. |
This function is used internally in igp_sim()
to calculate the number of individuals of each dispersing from patch i to patch j. Emigrants from patch i are more likely to become Immigrants to patch j if the patches are closer together.
A matrix of abundances after accounting for dispersal with nrow = n_sp = 3
and ncol = n_patch
. Values may be returned with decimal values, but will be converted to integers using rpois()
within the simulation model.
1 2 3 4 5 6 7 8 | n_patch = 5
n_sp = 3
N = matrix(rpois(n_sp * n_patch, lambda = 10), nrow = n_sp, ncol = n_patch)
# sort coordinates so you can easily see increasing distances
x_coord = sort(runif(5, 0, 5))
y_coord = sort(runif(5, 0, 5))
dist_mat = data.matrix(dist(cbind(x_coord, y_coord)))
disperal_n(N = N, v_p_dispersal = 0.25, theta = 1, dist_mat = dist_mat)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.