boundary.crosser.rates.pa: Calculate speciation and extinction rates using the boundary...

Description Usage Arguments Value References See Also Examples

View source: R/range.calculations.intervals.R

Description

Calculate speciation and extinction rates using the boundary crosser approach

Usage

1
boundary.crosser.rates.pa(presence.absence, intervals, continuous = TRUE)

Arguments

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)

Value

Dataframe containing the following columns:

Note this approach does not return rates for the first interval.

References

Foote, M. 2000. Origination and extinction components of taxonomic diversity: General problems. Paleobiology 26: 74-102.

See Also

interval.types.bc.pa

Examples

 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")

rachelwarnock/fbdR documentation built on Aug. 23, 2019, 3:39 a.m.