Get speciation rates following equation 4 in Magallon and Sanderson (2001)
Source:R/estimate_MS.R
estimate_MS.Rd
Use methodology from Magallon and Sanderson (2001) to estimate speciation rates using a user-provided phylogeny 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)
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 when interacting with the tree. If "binomial," the full species name (including genus) will be used when interacting with the tree.
- 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", "Species", and "areas"
Value
A dataframe that includes speciation rates for each island in the user-provided occurrence record dataframe. #' @references
Magallόn, S. & Sanderson, M.J. (2001). Absolute Diversification Rates in Angiosperm Clades. Evolution, 55(9): 1762-1780.
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_MS(tree = tree,
label_type = "epithet",
occurrences = areas)
#> Error in UseMethod("Ntip"): no applicable method for 'Ntip' applied to an object of class "NULL"