Get tip speciation rates from BAMM (Rabosky 2014) analysis
Source:R/estimate_BAMM.R
speciationBAMM.Rd
Use the BAMMtools package (Rabosky et al. 2014) to extract tip speciation rates from user-supplied BAMM analysis objects.
Arguments
- label_type
Either "epithet" or "binomial" (default): describes the type of tip label in the tree used for the BAMM analysis. 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"
- edata
The eventdata object created by using the
BAMMtools::getEventData()
function
Value
A dataframe that includes speciation rates for each species in the occurrence record dataframe
Examples
if (FALSE) { # \dontrun{
key <- get_key(query = "Anolis", rank = "genus")
dat <- get_data(key = key, limit = 100)
land <- find_land(occurrences = dat)
areas <- find_areas(occs = land)
# Read tree from Patton et al. (2021), trimmed to Caribbean species
tree <- ape::read.tree(system.file("extdata",
"Patton_Anolis_trimmed.tree",
package = "SSARP"))
# Event data file from an external BAMM run
event_data <- system.file("extdata",
"event_data_Patton_Anolis.txt",
package = "SSARP")
edata <- BAMMtools::getEventData(phy = tree, eventdata = event_data)
occ_speciation <- speciationBAMM(label_type = "epithet",
occurrences = areas ,
edata = edata)
} # }