You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .github/CONTRIBUTING.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -31,7 +31,7 @@ See tidyverse's guide on [how to create a great issue](https://code-review.tidyv
31
31
32
32
* Please do not restyle code that has nothing to do with your PR.
33
33
34
-
* New code should follow the tidyverse [style guide](https://style.tidyverse.org), with one exception: please use camelCase for new function names, or create an alias so that both snake_case and camelCase work for the function call.
34
+
* New code should follow the tidyverse [style guide](https://style.tidyverse.org).
35
35
36
36
* We use [roxygen2](https://cran.r-project.org/package=roxygen2), with [Markdown syntax](https://cran.r-project.org/web/packages/roxygen2/vignettes/rd-formatting.html), for documentation.
Copy file name to clipboardExpand all lines: NEWS.md
+7Lines changed: 7 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,10 @@
1
+
ssarp 0.5.0 (2025-09-16)
2
+
=========================
3
+
4
+
### NEW FEATURES
5
+
6
+
* The default versions of `create_SAR()`, `create_SpAR()`, `estimate_BAMM()`, `estimate_DR()`, and `estimate_MS()` are now all-lowercase (`create_sar()`, `create_spar()`, `estimate_bamm()`, `estimate_dr()`, and `estimate_ms()`). The original spellings have been added as aliases to the functions (both spellings may be used).
Copy file name to clipboardExpand all lines: README.Rmd
+5-5Lines changed: 5 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -176,11 +176,11 @@ The "area_dat" dataframe includes records with GPS points that are associated wi
176
176
177
177
#### Step 4: Create the species-area relationship
178
178
179
-
Finally, we will generate the SAR using the `ssarp::create_SAR()` function. The `ssarp::create_SAR()` function creates multiple regression objects with breakpoints up to the user-specified “npsi” parameter. For example, if “npsi” is two, `ssarp::create_SAR()` will generate regression objects with zero (linear regression), one, and two breakpoints. The function will then return the regression object with the lowest AIC score. The “npsi” parameter will be set to one in this example. Note that if linear regression (zero breakpoints) is better-supported than segmented regression with one breakpoint, the linear regression will be returned instead.
179
+
Finally, we will generate the SAR using the `ssarp::create_sar()` function. The `ssarp::create_sar()` function creates multiple regression objects with breakpoints up to the user-specified “npsi” parameter. For example, if “npsi” is two, `ssarp::create_sar()` will generate regression objects with zero (linear regression), one, and two breakpoints. The function will then return the regression object with the lowest AIC score. The “npsi” parameter will be set to one in this example. Note that if linear regression (zero breakpoints) is better-supported than segmented regression with one breakpoint, the linear regression will be returned instead.
This is the species-area relationship (SAR) for Anolis including island-based occurrences within a polygon around Caribbean islands from the first 10,000 records for the genus in GBIF! The best-fit model was a segmented regression with one breakpoint. The R console will also output statistical information about the model.
@@ -194,15 +194,15 @@ Species-area relationships (SARs) and speciation-area relationships (SpARs) are
194
194
1. Use `rgbif` to gather occurrence records, or input your own dataframe of occurrence records.
195
195
2. Use `find_land()` with the dataframe obtained in Step 1 to figure out the names of landmasses using the occurrence record GPS points and the [*maps* R package](https://cran.r-project.org/web/packages/maps/index.html). Setting the `fillgaps` parameter to `TRUE` will enable the use of [Photon API](https://photon.komoot.io/) to fill in any missing landmass names left by the *maps* R package.
196
196
3. Use `find_areas()` with the dataframe obtained in Step 2 to match the landmass names to a dataset that includes names of most islands on the planet and their areas. If the user would like to use a custom island area dataset instead of the built-in one, the `area_custom` parameter can be set to the name of the custom island area dataframe. If you'd like to only include occurrence records from islands, you can remove continental records by using `remove_continents()` with the dataframe returned by `find_areas()`
197
-
4. Use `create_SAR()` with the dataframe obtained in Step 3 to create a species-area relationship plot that reports information important to the associated regression. The `npsi` parameter indicates the maximum number of breakpoints the user would like to compare for model selection. The returned model and plot correspond with the best-fit model.
197
+
4. Use `create_sar()` with the dataframe obtained in Step 3 to create a species-area relationship plot that reports information important to the associated regression. The `npsi` parameter indicates the maximum number of breakpoints the user would like to compare for model selection. The returned model and plot correspond with the best-fit model.
198
198
199
199
### Workflow summary for using data from GBIF and a user-provided phylogenetic tree to create a speciation-area relationship plot
200
200
201
201
1. Use `rgbif` to gather occurrence records, or input your own dataframe of occurrence records.
202
202
2. Use `find_land()` with the dataframe obtained in Step 1 to figure out the names of landmasses using the occurrence record GPS points and the [*maps* R package](https://cran.r-project.org/web/packages/maps/index.html). Setting the `fillgaps` parameter to `TRUE` will enable the use of [Photon API](https://photon.komoot.io/) to fill in any missing landmass names left by the *maps* R package.
203
203
3. Use `find_areas()` with the dataframe obtained in Step 2 to match the landmass names to a dataset that includes names of most islands on the planet and their areas. If the user would like to use a custom island area dataset instead of the built-in one, the `area_custom` parameter can be set to the name of the custom island area dataframe. If you'd like to only include occurrence records from islands, you can remove continental records by using `remove_continents()` with the dataframe returned by `find_areas()`
204
-
4. Use either `estimate_DR()` or `estimate_MS()` with your own phylogenetic tree that corresponds with the taxa signified in previous steps, a classifier that describes your tip labels (whether the tip labels are simply species epithets or full scientific names), and the dataframe obtained in Step 3 to add tip speciation rates using the DR statistic (Jetz et al. 2012) or the lambda calculation for crown groups from Magallόn and Sanderson (2001) respectively to the occurrence dataframe. The user may also choose to estimate tip speciation rates from a BAMM analysis (Rabosky 2014) by using `estimate_BAMM()` with a classifier that describes your tip labels (whether the tip labels are simply species epithets or full scientific names), the occurrence record dataframe obtained in Step 3, and a `bammdata` object generated by reading the event data file from a BAMM analysis with the *BAMMtools* package (Rabosky et al. 2014).
205
-
5. Use `create_SpAR(occ, npsi)` with the dataframe obtained in Step 4 to create a speciation-area relationship plot that reports information important to the associated regression. The `npsi` parameter indicates the maximum number of breakpoints the user would like to compare for model selection. The returned model and plot correspond with the best-fit model.
204
+
4. Use either `estimate_dr()` or `estimate_ms()` with your own phylogenetic tree that corresponds with the taxa signified in previous steps, a classifier that describes your tip labels (whether the tip labels are simply species epithets or full scientific names), and the dataframe obtained in Step 3 to add tip speciation rates using the DR statistic (Jetz et al. 2012) or the lambda calculation for crown groups from Magallόn and Sanderson (2001) respectively to the occurrence dataframe. The user may also choose to estimate tip speciation rates from a BAMM analysis (Rabosky 2014) by using `estimate_bamm()` with a classifier that describes your tip labels (whether the tip labels are simply species epithets or full scientific names), the occurrence record dataframe obtained in Step 3, and a `bammdata` object generated by reading the event data file from a BAMM analysis with the *BAMMtools* package (Rabosky et al. 2014).
205
+
5. Use `create_spar(occ, npsi)` with the dataframe obtained in Step 4 to create a speciation-area relationship plot that reports information important to the associated regression. The `npsi` parameter indicates the maximum number of breakpoints the user would like to compare for model selection. The returned model and plot correspond with the best-fit model.
206
206
207
207
### Some helpful notes about well-known text (WKT) representation of geometry
208
208
When using `rgbif::occ_search` to gather occurrence records from GBIF, the user can specify a well-known text (WKT) representation of geometry to restrict the geographic location of the returned occurrence records. The `rgbif::occ_search` function requires a counter-clockwise winding order for WKT. I find it helpful to think about WKT polygons in this way: imagine a square around your geographic area of interest and pick one of the corners as a starting point. The order of points in WKT format should follow counter-clockwise from the corner you picked first, and the final entry in the WKT string needs to be the same as the first entry. Additionally, while GPS points are typically represented in "latitude, longitude" format, WKT expects them in "longitude latitude" format with commas separating the points rather than individual longitude and latitude values. WKT polygons can have more specified points than included in this simple square example, and even include polygons nested within others or polygons with holes in the middle.
0 commit comments