calcFossilDivTT: Calculate paleo diversity curves through different methods

View source: R/calcFossilDivTT.R

calcFossilDivTTR Documentation

Calculate paleo diversity curves through different methods

Description

calcFossilDivTT calculates fossil diversity through time using different methods.

Usage

calcFossilDivTT(
  data,
  tax.lvl = "species",
  method = "rangethrough",
  bin.reso = 1
)

Arguments

data

A data.frame containing the columns: max_ma, min_ma and the name provided in tax.lvl. max_ma and min_ma are respectively the early and late bounds of rock layer's age. tax.lvl column is the taxonomic level of the data. Any additional columns are ignored.

tax.lvl

A character giving the taxonomic in which calculations will be based on (default value is "species"). This must refer to the column names in data.

method

A character string setting the method which should be used. Could be either "rangethrough" or "stdmethod", which will respectively calculate diversity using the range through or the standard methods (Foote & Miller, 2007)

bin.reso

A numeric assigning the resolution (length) of the time bin to consider in calculations. Default value is 1 (which in most cases - e.g. those following the Paleobiology Database default timescale - will equate to one million years)

Value

A data.frame containing the diversity (column div) of the chosen taxonomic level through time, with calculation based on method. If "method = rangethrough", the time moments are the layer boundaries given in data. If "method = stdmethod", the time moments are evenly-space bins with length equal to bin.reso, starting at the earliest bound in the dataset.

Author(s)

Matheus Januario, Jennifer Auler

References

Foote, M., Miller, A. I., Raup, D. M., & Stanley, S. M. (2007). Principles of paleontology. Macmillan.

Examples


# Loading data
data("dinos_fossil")

# Using function:
div1 <- calcFossilDivTT(dinos_fossil, method = "stdmethod")
div2 <- calcFossilDivTT(dinos_fossil, method = "stdmethod", bin.reso = 10)

# Comparing different bins sizes in the standard method
plot(x=div1$age, y=div1$div, type="l", 
     xlab = "Time (Mya)", ylab = "Richness", 
     xlim=rev(range(div1$age)), col="red") 
lines(x=div2$age, y=div2$div, col="blue")

# Comparing different methods:
div3 <- calcFossilDivTT(dinos_fossil, method = "rangethrough")
plot(x=div1$age, y=div1$div, type="l", 
     xlab = "Time (Mya)", ylab = "Richness", 
     xlim=rev(range(div1$age)), col="red") 
lines(x=div3$age, y=div3$div, col="blue")


evolved documentation built on April 3, 2025, 9:23 p.m.