init.popgensim: Initialise a spatial meta-population for a popgen simulation

View source: R/popdynfun.r

init.popgensimR Documentation

Initialise a spatial meta-population for a popgen simulation

Description

This functions initialises a time-forward, agent-based and spatiallly explicit genetic meta-population simulation

Usage

init.popgensim(
  n.pops,
  n.ind,
  sex.ratio,
  n.loci,
  n.allels,
  locs = NULL,
  n.cov = 3
)

Arguments

n.pops

number of subpopulations

n.ind

number of individuals per subpopulation

sex.ratio

sex ratio of males and females

n.loci

number of loci

n.allels

number of maximal alleles per loci

locs

coordinates of the subpopulations, provided as a row named data.frame(x=, y=) with n.pops rows.[Only used to name the subpopulations by row.names(locs). If not provided subpopulations are simply numbered.

n.cov

number of covariates (currenlty do not change, defaults to 3. In future versions covariates such as age etc. will be implemented)

Details

To set up a population we have to specify the following parameters: n.pops defines the number of subpopulations and n.ind the number of individuals within subpopulations (carrying capacity). In the current implementaiton all subpopulations have the same number of individuals. sex.ratio determines the proportion of females in a subpopulation. finaly the number of loci and number of alleles need to be specified. locs is used to name the populations. For simplicity the names are provided via a data.frame of x and y coordinates (as they normally come from a genind object)

Value

a simpops object (to be used in run.popgensim ), which is a list of subpopulations. Each subpopulation consists of a data.frame with a row for each individual (coding the covariates and genetic make-up).

See Also

run.popgensim

Examples

init.popgensim(n.pops = 5, n.ind=8, sex.ratio = 0.25, n.loci = 4, n.allels = 7, n.cov = 3)

PopGenReport documentation built on Oct. 11, 2023, 9:07 a.m.