sim.extant.samples: Include extant samples in the fossil object, with optional...

View source: R/sim.tip.sampling.R

sim.extant.samplesR Documentation

Include extant samples in the fossil object, with optional rho sampling.

Description

Include extant samples in the fossil object, with optional rho sampling.

Usage

sim.extant.samples(fossils, tree = NULL, taxonomy = NULL, rho = 1, tol = NULL)

Arguments

fossils

Fossils object.

tree

Phylo object.

taxonomy

Taxonomy object.

rho

Extant species sampling probability. Can be a single value or a vector. Vector entries will be applied to extant tips in the order in which they appear in the taxonomy object.

tol

Rounding error tolerance for tip ages.

Value

An object of class fossils containing extant tip samples equal to the age of the tips (i.e. 0.0).

Examples

# simulate tree
lambda = 0.1
mu = 0.05
tips = 8
t = TreeSim::sim.bd.taxa(tips, 1, lambda, mu)[[1]]

# simulate fossils
f = sim.fossils.poisson(0.5, t)

# simulate extant samples
f = sim.extant.samples(f, t, rho = 0.5)
plot(f, t)


FossilSim documentation built on Oct. 5, 2023, 5:08 p.m.