Learn R Programming

coala (version 0.1.1)

coal_model: Creates a coalescent model

Description

This creates a basic coalescent model to which more features, loci, parameters and summary statistics can be added. Data under the model can be simulated using the simulate function.

Usage

coal_model(sample_size, loci_number = 0, loci_length = 1000)

Arguments

sample_size
Defines the number of populations and the number of samples taken from each population. Given as an integer vector which length defines the number of population and each entry gives the number of haploids sampled from the corresponding population.
loci_number
You can optionally add a number of loci with equal length to the model. This gives to number of loci to add.
loci_length
This gives the length of the loci to add.

Value

  • The coalescent model

Examples

Run this code
model <- coal_model(5, 10, 100) + feat_mutation(1) + sumstat_sfs()
simulate(model)

model <- coal_model(c(2, 2), 1, 10) +
  feat_recombination(1) +
  feat_migration(0.5, symmetric = TRUE) +
  sumstat_trees()
simulate(model)

Run the code above in your browser using DataLab