Learn R Programming

FossilSim (version 2.4.1)

sampled.tree.from.combined: Removes all unsampled lineages from a combined tree. Extinct tips are only sampled if they are fossils. With default settings all extant tips are sampled.

Description

Removes all unsampled lineages from a combined tree. Extinct tips are only sampled if they are fossils. With default settings all extant tips are sampled.

Usage

sampled.tree.from.combined(tree, rho = 1, sampled_tips = NULL)

Value

Sampled tree with fossils.

Arguments

tree

Combined tree with fossils.

rho

Sampling probability of extant tips. Default 1, will be disregarded if sampled_tips is not null.

sampled_tips

List of tip labels corresponding to sampled extant tips.

Examples

Run this code
# simulate tree
t = ape::rtree(6)

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

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

# transform to sampled tree
t3 = sampled.tree.from.combined(t2)
plot(t3)

Run the code above in your browser using DataLab