feat_pop_merge {coala} | R Documentation |
Feature: Population Merge
Description
Backwards in time, this feature merges one population into another. Forwards in time, this corresponds to a speciation event.
Usage
feat_pop_merge(time, pop_source, pop_target, locus_group = "all")
Arguments
time |
The time at which the merge occurs. |
pop_source |
The population from which all lines are moved. This is the newly created population in the speciation event. |
pop_target |
The population to which the lines are moved. This is the population in which the speciation event occurs. |
locus_group |
The loci for which this features is used. Can either be
|
Details
In addition to the merge, the growth rate of and all migration rates from
the source population will be set to 0 at the time of the merge to mimic
a speciation event forwards in time. Technically, pop_source
is
still present in the model, but not used unless migration to the population
is manually enabled.
Value
The feature, which can be added to a model created with
coal_model
using +
.
See Also
For creating a model: coal_model
Other features:
feat_growth()
,
feat_ignore_singletons()
,
feat_migration()
,
feat_mutation()
,
feat_outgroup()
,
feat_recombination()
,
feat_selection()
,
feat_size_change()
,
feat_unphased()
Examples
# Two population which merge after 0.5 time units:
model <- coal_model(c(25,25), 1) +
feat_pop_merge(0.5, 2, 1) +
feat_mutation(5) +
sumstat_tajimas_d()
simulate(model)
# An standard isolation-with-migration model:
model_iwm <- model +
feat_migration(.75, symmetric = TRUE)
simulate(model_iwm)