SAtree.from.fossils: Transforms a tree and fossils dataframe to a combined SA...

View source: R/SAtree.R

SAtree.from.fossilsR Documentation

Transforms a tree and fossils dataframe to a combined SA tree. Sampled ancestors are represented as tips on zero-length edges to maintain compatibility with the ape format. Tip labels are set to "species id"_"index", where the most recent tip of a given species receives index 1 and indices increase towards the past.

Description

Transforms a tree and fossils dataframe to a combined SA tree. Sampled ancestors are represented as tips on zero-length edges to maintain compatibility with the ape format. Tip labels are set to "species id"_"index", where the most recent tip of a given species receives index 1 and indices increase towards the past.

Usage

SAtree.from.fossils(tree, fossils)

Arguments

tree

Phylo object.

fossils

Fossils object.

Value

A list of 'tree', the SA tree integrating the fossils, and 'fossils', the fossils object updated with the tip label of each sample.

Examples

# simulate tree
t = ape::rtree(6)

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

# transform format
t2 = SAtree.from.fossils(t,f)
plot(t2$tree)

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