## Simulate 2 islands for 1 million years, where all species have equal
## rates. Pool size 100.
clado_rate <- 0.5
ext_rate <- 0.2
carr_cap <- Inf
immig_rate <- 0.05
ana_rate <- 1
sim_pars <- c(clado_rate, ext_rate, carr_cap, immig_rate, ana_rate)
set.seed(1)
island_replicates <- DAISIE_sim_cr(
time = 1,
M = 100,
pars = sim_pars,
replicates = 2,
plot_sims = FALSE,
verbose = FALSE
)
## Simulate 2 islands for 1 million years with two types of species (type1
## and type 2). Pool size 100
## Fraction of type 2 species in source pool is 0.15. Function will
## simulate until number of islands where type 2 species has colonised is
## equal to number specified in replicates.
clado_rate <- 0.5
ext_rate <- 0.2
carr_cap <- Inf
immig_rate <- 0.005
ana_rate <- 1
sim_pars_type1 <- c(clado_rate, ext_rate, carr_cap, immig_rate, ana_rate)
sim_pars_type2 <- sim_pars_type1 * 2
set.seed(1)
island_replicates_2types <- DAISIE_sim_cr(
time = 1,
M = 100,
pars = c(sim_pars_type1, sim_pars_type2),
replicates = 2,
prop_type2_pool = 0.15,
plot_sims = FALSE,
verbose = FALSE
)
## Simulate two non-oceanic island for 1 million years.
## Pool size 500. Island area as a proportion
## of mainland is 0.1, proportion of native species is 0.9.
clado_rate <- 0.5
ext_rate <- 0.2
carr_cap <- Inf
immig_rate <- 0.005
ana_rate <- 1
sim_pars <- c(clado_rate, ext_rate, carr_cap, immig_rate, ana_rate)
set.seed(1)
island_replicates <- DAISIE_sim_cr(
time = 1,
M = 500,
pars = sim_pars,
replicates = 2,
nonoceanic_pars = c(0.1, 0.9),
plot_sims = FALSE,
verbose = FALSE
)
## Simulate 2 islands for 1 million years with a shift in immigration rate
## at 0.195 Ma, and plot the species-through-time plot. Pool size 296.
pars_before_shift <- c(0.079, 0.973, Inf, 0.136, 0.413)
pars_after_shift <- c(0.079, 0.973, Inf, 0.652, 0.413)
tshift <- 0.195
set.seed(1)
island_shift_replicates <- DAISIE_sim_cr_shift(
time = 1,
M = 296,
pars = c(pars_before_shift, pars_after_shift),
replicates = 2,
shift_times = tshift,
plot_sims = FALSE,
verbose = FALSE
)
Run the code above in your browser using DataLab