simulate_lineages: Simulate Lineages

Description Usage Arguments Value

Description

Given a collection of lineages, all of the same genotype, sample from their locations across previous generations, given the entire set of reproductive numbers in those generation.

Usage

1
simulate_lineages(lineages, gens, num.alleles, demog, ...)

Arguments

lineages

A two-column matrix with columns labeled 'location' and 'genotype'.

gens

A list as returned by simulate_pop(...,return=everything=TRUE).

num.alleles

A vector giving the number of alleles of the type followed in each genotype.

demog

The demography object that contains migration matrices used to make the simulation.

...

Other parameters passed to lineage_generation().

Value

An array of dimensions c(dim(lineages),length(gens$times)), in the SAME order as gens$times, so that if x is the output, x[,,1] records lineage locations at the *most distant* time, x[,1,1] gives the index of the spatial locations, and x[,2,1] gives the index of the genotypes of the lineages. See plot_lineages for how to recover coordinates of the lineages.


petrelharp/landsim documentation built on May 25, 2019, 2:53 a.m.