The engine of simulate_metacommunity(), for users who want to supply
their own growth rates (e.g. responses to several environmental variables).
Usage
mc_dynamics(
r,
alpha,
dispersal,
n_steps = 1000,
seed_steps = seq(10, 100, 10),
seed_mean = 0.5,
disp_matrix = NULL,
record_steps = NULL,
sites = NULL,
species = NULL,
extirpation = 0
)Arguments
- r
Sites x species matrix of density-independent growth rates, or a function of the time step that returns such a matrix.
- alpha
Competition matrix from
competition_matrix(), with species in the same order as the rows oftraits.- dispersal
Emigration probability, one value or one per species.
- n_steps
Number of time steps.
- seed_steps
Steps at which individuals are added during colonisation.
- seed_mean
Mean number of individuals of each species added to each site at each seeding step (and at the start).
- disp_matrix
Row-stochastic dispersal matrix (sites x sites), or
NULLfor uniform dispersal.- record_steps
Optional steps at which abundances are recorded.
- sites, species
Optional names of sites and species.
- extirpation
Probability that a population is lost at each time step, one value or one per species.
Value
List with abundance and history, as in
simulate_metacommunity().
