sample.coalescents: sample.coalescents

View source: R/simInnerTree.R

sample.coalescentsR Documentation

sample.coalescents

Description

Draw waiting times for all compartments that have two or more extant lineages.

Usage

sample.coalescents(run, current.time)

Arguments

run:

an R6 object of class Run'

current.time:

current simulation time for inner tree

Value

Named numeric vector of waiting times per extant compartment

Examples

# this model specifies 10 compartments with 3 lineages each,
# and constant coalescent rate 1.0
path <- system.file('extdata', 'SI.yaml', package='twt')
settings <- yaml.load_file(path)
mod <- Model$new(settings)
run <- Run$new(mod)

# these should average 0.333
sample.coalescents(run, 0)


PoonLab/twt documentation built on Nov. 7, 2024, 4:18 a.m.