Description Usage Arguments Value See Also Examples
View source: R/sim.metapopgen.dioecious.multilocus.OLD.R View source: R/sim.metapopgen.dioecious.multilocus.R
Simulates the metapopulation genetics. The function will calculate automatically from its arguments the number of gamete type l
, the number of genotypes m
, the number of demes n
and the number of age-classes z
. It is therefore important that all the arguments have the correct dimensions and size.
1 2 3 4 5 6 | sim.metapopgen.dioecious(input.type,demographic.data,
N1_M,N1_F,sigma_M,sigma_F,
phi_M,phi_F,List_gene,List_mu,r,
delta,recr.dd="settlers",
kappa0,T_max,save.res=F,
save.res.T=seq(1,T_max),verbose=F)
|
input.type |
Character vector defining whether the input data are giving as arrays ( |
demographic.data |
If the input is given as a data.frame ( |
N1_M |
Number of male individuals at the beginning of the simulation. 3-D array giving the number of individuals of each genotype in each deme and each age-class at the beginning of the simulation. The first dimension is the genotype, the second dimension is the deme and the third dimension is the age-class. To be used when |
N1_F |
Number of female individuals at the beginning of the simulation. The same as |
sigma_M |
Survival probabilities for males. 4-D array of length c(m,n,z,T_max). |
sigma_F |
Survival probabilities for females. The same as |
phi_F |
Mean female fecundity. 4-D array of length c(m,n,z,T_max). |
phi_M |
Mean male fecundity. 4-D array of length c(m,n,z,T_max). |
List_gene |
List with the number of allele for each loci. |
List_mu |
List with the mutation rate of each loci. |
r |
Parameter defining the recombination probability in simulations with two loci. |
delta |
Dispersal probabilities. Square matrix of size |
recr.dd |
Defines how settler survival probabilities depend on density. If "settlers" (default), settler survival probabilities depends on the number of settlers, through the function |
kappa0 |
2-D array of length c(n,T_max). Carrying capacity used to calculate the density-dependent settler survival probabilities. If the argument |
T_max |
Number of years of simulations. |
save.res |
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 |
verbose |
Boolean. If TRUE, the function will print much information, mainly used for debugging purposes. Default to FALSE. |
If save.res
is FALSE: a named list with two elements, N_M
and N_F
, both 4-D arrays (ex: N_M[k,i,x,t] N_F[k,i,x,t]
) of length c(m,n,z,tmax) giving the number of male and female individuals of genotype k
, age x
in deme i
at time t
.
If save.res
is 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). Each file will contain the variables N_M and N_F, both 3-D arrays (N_M[k,i,x] N_F[k,i,x]
) of length c(m,n,z) giving the number of male and fenale individuals of genotype k
, age x
in deme i
at that time.
For more information, have a look in the tutoriel 3 that you can find on: https://sites.google.com/site/marcoandrello/metapopgen
1 2 3 4 5 6 7 8 9 | data("MultiDioecious")
N<-sim.metapopgen.dioecious.multilocus(input.type = "array",N1_M=N1_M,N1_F=N1_F,sigma_M = sigma_M,sigma_F = sigma_F,phi_M = phi_M,phi_F = phi_F,List_gene = List_gene,List_mu=List_mu,delta=delta,kappa0=kappa0,T_max=5)
# This will save results on disk:
sim.metapopgen.dioecious.multilocus(input.type = "array",N1_M=N1_M,N1_F=N1_F,sigma_M = sigma_M,sigma_F = sigma_F,phi_M = phi_M,phi_F = phi_F,List_gene = List_gene,List_mu=List=mu, delta=delta,kappa0=kappa0,T_max=5,save.res=T)
#with a Data.frame
data("DataFrameDioeciousMulti")
sim.metapopgen.dioecious.multilocus(input.type = "data.frame",demographic.data = demographic.data,List_gene = List_gene,List_mu=List_mu, delta=delta,kappa0=kappa0,T_max=5)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.