Learn R Programming

FossilSim (version 2.4.1)

reconstructed.tree.fossils.objects: Returns tree and fossil objects that you can use to plot the reconstructed tree.

Description

Note that for datasets containing extinct only samples (& rho = 0) the ages output are scaled so that the youngest sample = 0.

Usage

reconstructed.tree.fossils.objects(fossils, tree, rho = 1)

Value

A list containing the tree and fossil objects.

Arguments

fossils

Fossils object.

tree

Tree object.

rho

Extant species sampling probability. Default = 1, will be disregarded if fossils object already contains extant samples.

Examples

Run this code
# simulate tree
birth = 0.1
death = 0.05
tips = 10
t = TreeSim::sim.bd.taxa(tips, 1, birth, death)[[1]]

# simulate fossils
f = sim.fossils.poisson(rate = 0.3, tree = t)

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

# plot the complete tree
plot(f,t)

# generate tree & fossil objects corresponding to the reconstructed tree
out = reconstructed.tree.fossils.objects(f, t)
f.reconst = out$fossils
t.reconst = out$tree

# plot the reconstructed tree
plot(f.reconst, t.reconst)

Run the code above in your browser using DataLab