sim.interval.ages: Reassign fossil ages to user-specified stratigraphic...

View source: R/sim.interval.ages.R

sim.interval.agesR Documentation

Reassign fossil ages to user-specified stratigraphic intervals

Description

Reassign exact fossil ages using the minimum and maximum ages of a set of stratigraphic intervals. If use.species.ages = TRUE the function will respect species durations and will not return minimum and maximum bounds that may be younger or older than the species durations. This requires supplying a phylo or taxonomy object.

Usage

sim.interval.ages(
  fossils,
  tree = NULL,
  taxonomy = NULL,
  interval.ages = NULL,
  max.age = NULL,
  strata = NULL,
  use.species.ages = FALSE,
  root.edge = TRUE,
  sim.extant = FALSE
)

Arguments

fossils

Fossil object.

tree

Phylo object.

taxonomy

Taxonomy object.

interval.ages

Vector of stratigraphic interval ages, starting with the minimum age of the youngest interval and ending with the maximum age of the oldest interval.

max.age

Maximum age of the oldest stratigraphic interval.

strata

Number of stratigraphic intervals.

use.species.ages

If TRUE reassigned fossil ages will respect the speciation times. Default = FALSE.

root.edge

If TRUE include root edge.

sim.extant

If TRUE simulate age uncertainty for extant samples as well, default FALSE.

Value

An object of class fossils.

Examples

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

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

# assign a max age based on tree height
max.age = tree.max(t)

# define intervals
times = seq(0, max.age, length.out = 5)

# reassign ages
f = sim.interval.ages(f, t, interval.ages = times)

# plot output
plot(f, t, interval.ages = times)


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