create.ibm.population: Create an initial population

Description Usage Arguments Value Examples

View source: R/initial_pop.R

Description

Create an initial population by defining a release window, spatial layout, female/male distribution, age distribution and allele proportions for each loci

Usage

1
2
3
4
create.ibm.population(N = 50, spat.layout = "random",
  obs.win = owin(xrange = c(-10, 10), yrange = c(-10, 10), unitname =
  "metre"), prob.females = 0.5, age.distribution = c(10, 1, 7, 2),
  allele.prop = c(0.5, 0.9))

Arguments

N

Number of individuals in population

spat.layout

String to select layout options. Currently only "random" is implemented.

prob.females

Probability of females in population (0 - 1)

age.distribution

The age distribution for the population. Drawn from a normal distribution c(mean, sd) Age must be >= 1. Generated age is an integer. Separate age distribution properties may be given for females by setting age.distribution to a four value vector, in which case age distribution is c(male.mean, male.sd, female.mean,female.sd)

allele.prop

Proportion of allele Ai per ith loci for the population. Well mixed = 0.5, converged = 1.0 (or 0.0) Alleles are stored in the data frame as a vector of size 2 * number loci. This is done to make the breeding cycle easier when it is modelled. For example, with 2 alleles would be represented as (A1,B1,A2,B2) where A1 and A2 are the values on the 2 loci first strand, B1 B2 matching loci on second strand.

obs.owin

Observation window that defines the boundaries of the space where individuals are placed.

Value

A .ppp object containing N points and a marks dataframe that defines for each point a unique id, sex, age, male parent id, female parent id, and allele values.

Examples

1
2
3
# Create the default population and plot using plot.ppp
curr.pop <- create.ibm.population()
plot(curr.pop,use.marks=F,main="Initial Pop")

pwhigham/spatibm documentation built on Aug. 30, 2019, 1:16 p.m.