Description Usage Arguments Details Value Author(s) See Also Examples
View source: R/sim.metapopgen.monoecious.multilocus.R
Simulates the metapopulation genetics.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | sim.metapopgen.monoecious.multilocus(init.par,
sigma,
phi_F, phi_M,
fec.distr_F = "poisson", fec.distr_M = "poisson",
migration = "forward",
delta.prop, delta.ad, migr,
recr.dd = "settlers", kappa0,
T_max,
save.res = FALSE, save.res.T = seq(1:T_max),
output.var = "N",
verbose = FALSE)
sim.metapopgen.dioecious.multilocus(init.par,
sigma_F, sigma_M,
phi_F, phi_M,,
fec.distr_F = "poisson", fec.distr_M = "poisson",
delta.prop, delta.ad,
recr.dd = "settlers", kappa0,
T_max,
save.res = FALSE, save.res.T = seq(1:T_max),
output.var = "N",
verbose = FALSE)
|
init.par |
A list of arguments necessary to initialize the simulations and obtained with the function |
sigma, sigma_F, sigma_M |
Survival probabilities. 4-D array of length c(m,n,z,T_max). |
phi_F, phi_M |
Mean female and male fecundity. 4-D array of length c(m,n,z,T_max). |
fec.distr_F, fec.distr_M |
The distribution used to set fecundities: one of |
migration |
The type of propagule migration used, |
migr |
Migration rate used when |
delta.prop |
Dispersal probabilities for propagules. Square matrix of size |
delta.ad |
Dispersal probabilities for adults. Square matrix of size |
recr.dd |
Defines how population regulation is performed. Currently inactive. |
kappa0 |
2-D array of length c(n,T_max). Deme carrying capacity used to perform population regulation. |
T_max |
Number of years of simulations. |
save.res |
Boolean. If FALSE (default), the result of the simulation is stored in memory and returned to the user. If TRUE, the function does not return anything, but save the result in different files on disk. See "value" below. |
save.res.T |
Vector. If save.res=TRUE, this argument is used to define the time steps for which the state of the metapopulation will be saved on disk. It is used to save disk space in the case of long simulations with many demes or genotypes. It deafults to |
output.var |
A vector containing the names of the variables output by the simulation: |
verbose |
If TRUE, the function will print additional information, mainly used for debugging purposes. Default to FALSE. |
Element i,j
of propagule and adult dispersal matrices always indicates dispersal from deme j
to deme i
. Note that this may be not equal to the dispersal probability from deme i
to deme j
. As a consequence, the sum of the elements of each column is bounded to one, while the sum of the elements of rows is unbounded.
If save.res = FALSE
:
a named list where each element is one of the tracked variables (see argument output.var
). Each of these elements is an array giving the number of individuals of each genotype and deme. Specifically,
N
(monoecious life-cycle) or N_F
and N_M
(dioecious life-cycle)a 4-D array (ex: N[k,i,x,t])
of length c(m,n,z,T_max) giving the number of individuals of genotype k
, age x
in deme i
at time t
. This is the number of individuals at the beginning of the life cycle, just after recruitment and before adult survival.
Nprime
(monoecious life-cycle) or Nprime_F
and Nprime_M
(dioecious life-cycle)a 4-D array (ex: Nprime[k,i,x,t])
of length c(m,n,z,T_max) giving the number of individuals of genotype k
, age x
in deme i
at time t
after adult survival and before adult dispersal.
Nprimeprime
(monoecious life-cycle) or Nprimeprime_F
and Nprimeprime_M
(dioecious life-cycle)a 4-D array (ex: Nprimeprime[k,i,x,t])
of length c(m,n,z,T_max) giving the number of individuals of genotype k
, age x
in deme i
at time t
after adult dispersal.
L
(monoecious life-cycle) or L_F
and L_M
(dioecious life-cycle)a 3-D array (ex: L[k,i,t])
of length c(m,n,T_max) giving the number of propagules of genotype k
, in deme i
at time t
before propagule dispersal.
S
(monoecious life-cycle) or S_F
and S_M
(dioecious life-cycle)a 3-D array (ex: S[k,i,t])
of length c(m,n,T_max) giving the number of propagules of genotype k
, in deme i
at time t
after propagule dispersal.
If save.res = TRUE
:
the function does not return anything. Results are saved in files on disk. The function will create a folder named with the date and time of your simulation and create one RData file per year of simulation (but see argument save.res.T
for defining the time steps for which the results are saved) and per chosen output variables (N
, Nprime
, Nprimeprime
, L
and S
). The files will be named with the name of the output variable and the time step of simulation, e.g. N1.RData, S1.RData, etc.
The variables contained in each file are as described above for the case (save.res = FALSE
), but they do not have the time dimension. Specifically, N
, Nprime
and Nprimeprime
have length c(m,n,z), and L
and S
have length c(m,n).
For the dioecious life-cycle, each file contains two variables giving the genotype numbers for females and males for the specific output variable and time step.
Christelle Noirot
Marco Andrello
initialize.multilocus
create.dispersal.coord
create.dispersal.IM
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | ## Not run:
data("MultilocusMonoecious")
res <- sim.metapopgen.monoecious.multilocus(init.par = init.par,
sigma = sigma,
phi_F = phi_F, phi_M = phi_M,
delta.prop = delta.prop, delta.ad = delta.ad,
T_max = T_max)
data("MultilocusDioecious")
res <- sim.metapopgen.dioecious.multilocus(init.par = init.par,
sigma_F = sigma_F, sigma_M = sigma_M,
phi_F = phi_F, phi_M = phi_M,
delta.prop = delta.prop, delta.ad = delta.ad,
T_max = T_max)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.