Description Usage Arguments Value References See Also Examples
View source: R/range.calculations.intervals.R
Calculate speciation and extinction rates using the boundary crosser approach
1 | boundary.crosser.rates.pa(presence.absence, intervals, continuous = TRUE)
|
presence.absence |
Dataframe of presence/absence data. Each row represents a taxon and each column represents a time interval from oldest to youngest. |
intervals |
Dataframe of geological intervals. |
continuous |
If TRUE calculate continuous rates (i.e. account for interval length) |
Dataframe containing the following columns:
int
interval number. Intervals are numbered from oldest (=1) to youngest (>1)
int.name
Interval name
NFl
singletons
NFt
top boundary crossers
Nbl
bottom boundary crossers
Nbt
range through taxa
p
speciation rate
q
extinction rate
Note this approach does not return rates for the first interval.
Foote, M. 2000. Origination and extinction components of taxonomic diversity: General problems. Paleobiology 26: 74-102.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | # option 1: generate simulated data
set.seed(111)
# simulate tree
birth = 0.02
death = 0.01
tips = 400
t = TreeSim::sim.bd.taxa(tips, 1, birth, death)[[1]]
# simulate species (this may take a while esp. for large trees)
sp = FossilSim::sim.taxonomy(t)
# simulate fossils
f = FossilSim::sim.fossils.poisson(1, taxonomy = sp)
f = FossilSim::sim.extant.samples(f, taxonomy = sp)
# generate presence.absence matrix
pa = presence.absence.matrix(f, stages)
# option 2: load precooked presence absence matrix
pa = presence.absence.precooked
# calculate speciation & extinction rates
out = boundary.crosser.rates.pa(pa, stages)
# rates
mean(out$p, na.rm = TRUE)
mean(out$q, na.rm = TRUE)
# plot the output
snum = length(stages$name)
plot(1:snum, out$p, pch = 16, bty = "n", xlab = "stage #", ylab = "speciation")
lines(1:snum, rep(birth, snum), lty = 2, lwd = "2", col = 2)
plot(1:snum, out$q, pch = 16, bty = "n", xlab = "stage #", ylab = "extinction")
lines(1:snum, rep(death, snum), lty = 2, lwd = "2", col = "deepskyblue")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.