Skip to contents

Use methodology from Sun and Folk (2020) to calculate the DR statistic for each tip of a given tree and output a dataframe for use in SSARP's speciation-area relationship pipeline. This method also removes any species rows without rates (this is most likely to occur when the tree does not have all of the species included in the occurrence record dataframe). The tree read in the examples below is modified from Patton et al. (2021).

Usage

estimate_DR(tree, label_type = "binomial", occurrences)

Arguments

tree

The dated phylogenetic tree that corresponds with the taxa to be included in a speciation-area relationship

label_type

Either "epithet" or "binomial" (default): describes the type of tip label in the provided tree. If "epithet," only the species epithet will be used to match speciation rates to tips in the returned occurrence dataframe. If "binomial," the full species name (including genus) will be used to match speciation rates to tips in the returned occurrence dataframe.

occurrences

The occurrence record dataframe output from the SSARP pipeline. If you would like to use a custom dataframe, please make sure that there are columns titled "Genus" and "Species"

Value

A dataframe that includes speciation rates for each species in the occurrence record dataframe

References

  • Jetz, W., Thomas, G.H, Joy, J.B., Harmann, K., & Mooers, A.O. (2012). The global diversity of birds in space and time. Nature, 491: 444-448.

  • Patton, A.H., Harmon, L.J., del Rosario Castañeda, M., Frank, H.K., Donihue, C.M., Herrel, A., & Losos, J.B. (2021). When adaptive radiations collide: Different evolutionary trajectories between and within island and mainland lizard clades. PNAS, 118(42): e2024451118.

  • Sun, M. & Folk, R.A. (2020). Cactusolo/rosid_NCOMMS-19-37964-T: Code and data for rosid_NCOMMS-19-37964 (Version V.1.0). Zenodo. http://doi.org/10.5281/zenodo.3843441

Examples

# The GBIF key for the Anolis genus is 8782549
#  Obtained with: key <- get_key(query = "Anolis", rank = "genus")
key <- 8782549
# Read in example dataset obtained through:
#  dat <- get_data(key = key, limit = 100)
dat <- read.csv(system.file("extdata",
                            "SSARP_Example_Dat.csv",
                            package = "SSARP"))
land <- find_land(occurrences = dat)
areas <- find_areas(occs = land)
#>  Recording island names...
#>  Assembling island dictionary...
#>  Adding areas to final dataframe...

# Read tree from Patton et al. (2021), trimmed to Caribbean species
tree <- ape::read.tree(system.file("extdata", 
                                   "Patton_Anolis_trimmed.tree", 
                                   package = "SSARP"))
#> Warning: empty character string.

occ_speciation <- estimate_DR(tree = tree, 
                              label_type = "epithet", 
                              occurrences = areas)