Skip to content

Commit fa01fd3

Browse files
committed
Documentation edits, update NEWS
1 parent 54573b4 commit fa01fd3

29 files changed

+243
-145
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Title: ssarp (Species-/Speciation-Area Relationship Projector)
44
Description: Create Species- and Speciation-Area Relationships for any taxa.
55
Authors@R: person("Kristen", "Martinet", email = "kmartinet@outlook.com", role = c("aut", "cre"))
66
Maintainer: Kristen Martinet <kmartinet@outlook.com>
7-
Version: 0.3.0
7+
Version: 0.4.0
88
URL: https://github.com/kmartinet/ssarp, https://kmartinet.github.io/ssarp/
99
BugReports: https://github.com/kmartinet/ssarp/issues
1010
Imports:

NEWS.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,34 @@
1+
ssarp 0.4.0 (2025-07-19)
2+
=========================
3+
4+
### NEW FEATURES
5+
6+
* Package name is now `ssarp` instead of `SSARP`
7+
* Added the `ssarp::get_richness()` function, which creates a standard species richness dataframe
8+
* The `ssarp::get_data()` and `ssarp::get_key()` functions have been replaced by [a helpful vignette describing how to access occurrence records](https://kmartinet.github.io/ssarp/articles/Get_Data.html) using `rgbif`.
9+
* Messages across the package can be silenced using `options(ssarp.silent = TRUE)` now
10+
* A new example file for testing `ssarp::estimate_BAMM` has been added (`inst/extdata/event_data_Patton_Anolis.txt`)
11+
12+
### DOCUMENTATION FIXES
13+
14+
* All examples run instead of remaining in a `\dontrun` block
15+
* More information about using the metadata from plots created with `ssarp::create_SAR()` and `ssarp::create_SpAR()` has been added to their documentation
16+
* More information about the speciation rate estimation methods in `ssarp` have been added to the `ssarp::create_SpAR()` documentation
17+
18+
19+
### OTHER FIXES
20+
21+
* New `testthat` test cases to ensure that calculations are done correctly across the package
22+
* Column names have been standardized across the package
23+
* Plot printing is now off by default in `ssarp::create_SAR()` and `ssarp::create_SpAR()`
24+
25+
### DEPRECATED FUNCTIONS
26+
27+
* `get_data()`
28+
* `get_key()`
29+
* `quick_create_SAR()`
30+
31+
132
SSARP 0.3.0 (2025-07-04)
233
=========================
334

R/create_SAR.R

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
#' Use segmented regression to create a species-area relationship (SAR) plot.
44
#' The X axis represents log(island area) and the Y axis represents log(number
55
#' of species)
6-
#'
7-
#' If the user would prefer to create their own plot of the
6+
#'
7+
#' If the user would prefer to create their own plot of the
88
#' `ssarp::create_SAR()` output, the `aggDF` element of the returned list
99
#' includes the raw points from the plot created here. They can be accessed
1010
#' as demonstrated in the Examples section.
@@ -13,15 +13,15 @@
1313
#' specificEpithet, areas)
1414
#' @param npsi The maximum number of breakpoints to estimate for model
1515
#' selection. Default: 1
16-
#' @param visualize (boolean) Whether the plot should be displayed when the
16+
#' @param visualize (boolean) Whether the plot should be displayed when the
1717
#' function is called. Default: FALSE
1818
#' @return A list of 4 including: the summary output, the regression
1919
#' object, the aggregated dataframe used to create the plot, and the AIC scores
2020
#' used in model selection
2121
#' @examples
2222
#' # The GBIF key for the Anolis genus is 8782549
2323
#' # Read in example dataset filtered from:
24-
#' # dat <- rgbif::occ_search(taxonKey = 8782549,
24+
#' # dat <- rgbif::occ_search(taxonKey = 8782549,
2525
#' # hasCoordinate = TRUE,
2626
#' # limit = 10000)
2727
#' dat <- read.csv(system.file("extdata",
@@ -104,7 +104,7 @@ create_SAR <- function(occurrences, npsi = 1, visualize = FALSE) {
104104
# If the min_score is index 1, then the best-fit model is linear
105105
if (min_score == 1) {
106106
# Plot linear regression (if the user wants)
107-
if(visualize){
107+
if (visualize) {
108108
plot(
109109
dat,
110110
xlim = c(x_min, (x_max + 0.5)),
@@ -143,7 +143,7 @@ create_SAR <- function(occurrences, npsi = 1, visualize = FALSE) {
143143
)
144144

145145
# Plot the breakpoint regression line (if user wants)
146-
if(visualize){
146+
if (visualize) {
147147
plot(
148148
seg,
149149
rug = FALSE,
@@ -186,7 +186,7 @@ create_SAR <- function(occurrences, npsi = 1, visualize = FALSE) {
186186

187187
# Plot defaults to multiple outputs when npsi > 1, so my npsi = 1 plot
188188
# doesn't apply
189-
if(visualize){
189+
if (visualize) {
190190
plot(seg)
191191
}
192192

R/create_SpAR.R

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,34 +3,37 @@
33
#' Use segmented regression to create a speciation-area relationship plot. The
44
#' X axis represents log(island area) and the Y axis represents
55
#' log(speciation rate)
6-
#'
7-
#' If the user would prefer to create their own plot of the
6+
#'
7+
#' If the user would prefer to create their own plot of the
88
#' `ssarp::create_SpAR()` output, the `aggDF` element of the returned list
99
#' includes the raw points from the plot created here. They can be accessed
1010
#' as demonstrated in the Examples section.
11+
#'
12+
#' More information about the three methods for estimating speciation rate
13+
#' included in `ssarp` can be found in [ssarp's SpAR vignette](https://kmartinet.github.io/ssarp/articles/Create_SpAR.html).
1114
#' @param occurrences The dataframe output by one of ssarp's speciation
1215
#' methods (`ssarp::estimate_BAMM()`, `ssarp::estimate_DR()`,
1316
#' `ssarp::estimate_MS()`), or if using a custom dataframe, ensure that it
1417
#' has the following columns: areas, rate
1518
#' @param npsi The maximum number of breakpoints to estimate for model
1619
#' selection. Default: 1
17-
#' @param visualize (boolean) Whether the plot should be displayed when the
20+
#' @param visualize (boolean) Whether the plot should be displayed when the
1821
#' function is called. Default: FALSE
1922
#' @return A list of 4 including: the summary output, the regression
2023
#' object, the aggregated dataframe used to create the plot, and the AIC scores
2124
#' used in model selection
2225
#' @examples
2326
#' # The GBIF key for the Anolis genus is 8782549
2427
#' # Read in example dataset filtered from:
25-
#' # dat <- rgbif::occ_search(taxonKey = 8782549,
28+
#' # dat <- rgbif::occ_search(taxonKey = 8782549,
2629
#' # hasCoordinate = TRUE,
2730
#' # limit = 10000)
2831
#' dat <- read.csv(system.file("extdata",
2932
#' "ssarp_Example_Dat.csv",
3033
#' package = "ssarp"))
3134
#' land <- find_land(occurrences = dat)
3235
#' areas <- find_areas(occs = land)
33-
#'
36+
#'
3437
#' # Read tree from Patton et al. (2021), trimmed to Caribbean species
3538
#' tree <- ape::read.tree(system.file("extdata",
3639
#' "Patton_Anolis_trimmed.tree",
@@ -39,8 +42,8 @@
3942
#' occ_speciation <- estimate_MS(tree = tree,
4043
#' label_type = "epithet",
4144
#' occurrences = areas)
42-
#'
43-
#' seg <- create_SpAR(occurrences = occ_speciation,
45+
#'
46+
#' seg <- create_SpAR(occurrences = occ_speciation,
4447
#' npsi = 1,
4548
#' visualize = FALSE)
4649
#' plot(seg)
@@ -122,7 +125,7 @@ create_SpAR <- function(occurrences, npsi = 1, visualize = FALSE) {
122125

123126
# If the min_score is index 1, then the best-fit model is linear
124127
if (min_score == 1) {
125-
if(visualize){
128+
if (visualize) {
126129
plot(
127130
dat,
128131
xlim = c(x_min, (x_max + 0.5)),
@@ -161,7 +164,7 @@ create_SpAR <- function(occurrences, npsi = 1, visualize = FALSE) {
161164
)
162165

163166
# Plot the breakpoint regression line
164-
if(visualize){
167+
if (visualize) {
165168
plot(
166169
seg,
167170
rug = FALSE,
@@ -204,7 +207,7 @@ create_SpAR <- function(occurrences, npsi = 1, visualize = FALSE) {
204207

205208
# Plot defaults to multiple outputs when npsi > 1, so my npsi = 1 plot
206209
# doesn't apply
207-
if(visualize){
210+
if (visualize) {
208211
plot(seg)
209212
}
210213

R/estimate_BAMM.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
#' @examples
2727
#' # The GBIF key for the Anolis genus is 8782549
2828
#' # Read in example dataset filtered from:
29-
#' # dat <- rgbif::occ_search(taxonKey = 8782549,
29+
#' # dat <- rgbif::occ_search(taxonKey = 8782549,
3030
#' # hasCoordinate = TRUE,
3131
#' # limit = 10000)
3232
#' dat <- read.csv(system.file("extdata",
@@ -44,7 +44,7 @@
4444
#' event_data <- system.file("extdata",
4545
#' "event_data_Patton_Anolis.txt",
4646
#' package = "ssarp")
47-
#'
47+
#'
4848
#' edata <- BAMMtools::getEventData(phy = tree, eventdata = event_data)
4949
#'
5050
#' occ_speciation <- estimate_BAMM(label_type = "epithet",

R/estimate_DR.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
#' @examples
4646
#' # The GBIF key for the Anolis genus is 8782549
4747
#' # Read in example dataset filtered from:
48-
#' # dat <- rgbif::occ_search(taxonKey = 8782549,
48+
#' # dat <- rgbif::occ_search(taxonKey = 8782549,
4949
#' # hasCoordinate = TRUE,
5050
#' # limit = 10000)
5151
#' dat <- read.csv(system.file("extdata",
@@ -80,7 +80,7 @@ estimate_DR <- function(tree, label_type = "binomial", occurrences) {
8080
# estimate_DR documentation)
8181
rootnode <- length(tree$tip.label) + 1
8282
speciation_rates <- numeric(length(tree$tip.label))
83-
for (i in seq_len(length(speciation_rates))) {
83+
for (i in seq_along(speciation_rates)) {
8484
node <- i
8585
index <- 1
8686
qx <- 0

R/estimate_MS.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
#' @examples
2323
#' # The GBIF key for the Anolis genus is 8782549
2424
#' # Read in example dataset filtered from:
25-
#' # dat <- rgbif::occ_search(taxonKey = 8782549,
25+
#' # dat <- rgbif::occ_search(taxonKey = 8782549,
2626
#' # hasCoordinate = TRUE,
2727
#' # limit = 10000)
2828
#' dat <- read.csv(system.file("extdata",

0 commit comments

Comments
 (0)