Learn R Programming

FossilSim (version 2.4.1)

sim.extant.samples: 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)

Value

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

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.

Examples

Run this code
# 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)

Run the code above in your browser using DataLab