Skip to content

Commit 5dbbc89

Browse files
committed
Fix for R CMD check unicode warning
1 parent c8cf6a2 commit 5dbbc89

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

vignettes/Create_SpAR.Rmd

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ vignette: >
55
%\VignetteIndexEntry{Construct a Speciation-Area Relationship with ssarp}
66
%\VignetteEngine{knitr::rmarkdown}
77
%\VignetteEncoding{UTF-8}
8+
header-includes:
9+
- \usepackage{textgreek}
810
---
911

1012

@@ -67,19 +69,19 @@ tree <- read.tree(system.file("extdata",
6769
```
6870
![Phylogenetic tree from Patton et al. (2021) trimmed to include only anoles found on islands in the Caribbean.](anolis_tree.png)
6971

70-
Now that we have a phylogenetic tree, we can estimate tip speciation rates for use in our speciation-area relationship. *ssarp* includes three methods for estimating tip speciation rates: BAMM (Rabosky 2014), the lambda calculation for crown groups from Magallόn and Sanderson (2001), and DR (Jetz et al. 2012).
72+
Now that we have a phylogenetic tree, we can estimate tip speciation rates for use in our speciation-area relationship. *ssarp* includes three methods for estimating tip speciation rates: BAMM (Rabosky 2014), the lambda calculation for crown groups from `r if (knitr::is_html_output()) "Magallόn" else "Magallon"` and Sanderson (2001), and DR (Jetz et al. 2012).
7173

7274
The `ssarp::estimate_bamm()` function requires a `bammdata` object as input, which must be created using the `BAMMtools` package (Rabosky et al. 2014) after the user completes a BAMM analysis. This object includes tip speciation rates by default in the “meanTipLambda” list element, which `ssarp` accesses to add the appropriate tip speciation rates for each species to the occurrence record dataframe.
7375

7476
DR stands for “diversification rate,” but it is ultimately a better estimation of speciation rate than net diversification (Belmaker and Jetz 2015; Quintero and Jetz 2018) and returns results similar to BAMM’s tip speciation rate estimations (Title and Rabosky 2019). The `ssarp::estimate_dr()` function returns the values obtained from running an adapted version of the “DR_statistic” function from Sun and Folk (2020).
7577

76-
In addition to tip speciation rates, `ssarp` includes a function for calculating the speciation rate for a clade from Magallόn and Sanderson (2001). The `ssarp::estimate_ms()` function uses the `ape::subtrees` function (Paradis and Schliep 2019) to generate all possible subtrees from the user-provided phylogenetic tree that corresponds with the taxa of interest for the SpAR. Then, species in the provided occurrence records generated from previous steps in the `ssarp` workflow are grouped by island. For each group of species that comprise an island, the number of subtrees that represent that group of species and the root age of each subtree is recorded, along with the name and area of the island. The speciation rate for each subtree is then calculated following Equation 4 in Magallόn and Sanderson (2001). If an island includes multiple subtrees, the island speciation rate is the average of the calculated speciation rates. This average is calculated when the SpAR is plotted.
78+
In addition to tip speciation rates, `ssarp` includes a function for calculating the speciation rate for a clade from `r if (knitr::is_html_output()) "Magallόn" else "Magallon"` and Sanderson (2001). The `ssarp::estimate_ms()` function uses the `ape::subtrees` function (Paradis and Schliep 2019) to generate all possible subtrees from the user-provided phylogenetic tree that corresponds with the taxa of interest for the SpAR. Then, species in the provided occurrence records generated from previous steps in the `ssarp` workflow are grouped by island. For each group of species that comprise an island, the number of subtrees that represent that group of species and the root age of each subtree is recorded, along with the name and area of the island. The speciation rate for each subtree is then calculated following Equation 4 in `r if (knitr::is_html_output()) "Magallόn" else "Magallon"` and Sanderson (2001). If an island includes multiple subtrees, the island speciation rate is the average of the calculated speciation rates. This average is calculated when the SpAR is plotted.
7779

78-
In this example, we will use the lambda calculation for crown groups from Magallόn and Sanderson (2001) through the `ssarp::estimate_ms()` function. The "label_type" parameter in this function tells *ssarp* whether the tip labels on the given tree include the full species name (binomial) or just the specific epithet (epithet).
80+
In this example, we will use the lambda calculation for crown groups from `r if (knitr::is_html_output()) "Magallόn" else "Magallon"` and Sanderson (2001) through the `ssarp::estimate_ms()` function. The "label_type" parameter in this function tells *ssarp* whether the tip labels on the given tree include the full species name (binomial) or just the specific epithet (epithet).
7981

8082

8183
``` r
82-
# Calculate tip speciation rates using the lambda calculation for crown groups from Magallόn and Sanderson (2001)
84+
# Calculate tip speciation rates using the lambda calculation for crown groups from Magallon and Sanderson (2001)
8385
speciation_occurrences <- estimate_ms(tree = tree, label_type = "epithet", occurrences = nocont_dat)
8486
```
8587

@@ -119,15 +121,15 @@ create_spar(occurrences = speciation_occurrences, npsi = 1, visualize = TRUE)
119121
![This is the SpAR for *Anolis* including island-based occurrences within a polygon around Caribbean islands from the first 10000 records for the genus in GBIF! The best-fit model was a segmented regression with one breakpoint.](anolis_SpAR-1.png)
120122

121123

122-
You will notice that two of the largest islands have a speciation rate of zero in this example. This very likely occurred because the calculation for speciation rate in Magallόn and Sanderson (2001) that `ssarp::estimate_ms()` uses is based on monophyly, which can be disrupted on islands with non-native species occurrence records. When using the `ssarp::estimate_ms()` function to estimate speciation rates for a SpAR, it is incredibly important to manually filter the returned occurrence records to remove non-native species.
124+
You will notice that two of the largest islands have a speciation rate of zero in this example. This very likely occurred because the calculation for speciation rate in `r if (knitr::is_html_output()) "Magallόn" else "Magallon"` and Sanderson (2001) that `ssarp::estimate_ms()` uses is based on monophyly, which can be disrupted on islands with non-native species occurrence records. When using the `ssarp::estimate_ms()` function to estimate speciation rates for a SpAR, it is incredibly important to manually filter the returned occurrence records to remove non-native species.
123125

124126

125127
### Literature Cited
126128

127129
* Belmaker, J., & Jetz, W. (2015). Relative roles of ecological and energetic constraints, diversification rates and region history on global species richness gradients. Ecology Letters, 18: 563–571.
128130
* Jetz, W., Thomas, G.H., Joy, J.B., Hartmann, K., & Mooers, A.O. (2012). The global diversity of birds in space and time. Nature, 491: 444-448.
129131
* Losos, J.B. & Schluter, D. (2000). Analysis of an evolutionary species-area relationship. Nature, 408: 847-850.
130-
* Magallόn, S. & Sanderson, M.J. (2001). Absolute Diversification Rates in Angiosperm Clades. Evolution, 55(9): 1762-1780.
132+
* `r if (knitr::is_html_output()) "Magallόn" else "Magallon"`, S. & Sanderson, M.J. (2001). Absolute Diversification Rates in Angiosperm Clades. Evolution, 55(9): 1762-1780.
131133
* Paradis, E. & Schliep, K. (2019). ape 5.0: an environment for modern phylogenetics and evolutionary analyses in R. Bioinformatics, 35: 526-528.
132134
* 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.
133135
* Quintero, I., & Jetz, W. (2018). Global elevational diversity and diversification of birds. Nature, 555, 246–250.

0 commit comments

Comments
 (0)