Title: | Species-/Speciation-Area Relationship Projector |
---|---|
Description: | Create Species- and Speciation-Area Relationships using occurrence records or presence-absence matrices. |
Authors: | Kristen Martinet [aut, cre] (ORCID: <https://orcid.org/0000-0002-3905-9507>), Luke Harmon [ctb] (ORCID: <https://orcid.org/0000-0002-4985-5750>), Cristian Román-Palacios [ctb] (ORCID: <https://orcid.org/0000-0003-1696-4886>), Tom Matthews [rev] (Dr. Matthews reviewed the package for rOpenSci, see <https://github.com/ropensci/software-review/issues/685>), Joel Nitta [rev] (Dr. Nitta reviewed the package for rOpenSci, see <https://github.com/ropensci/software-review/issues/685>) |
Maintainer: | Kristen Martinet <[email protected]> |
License: | GPL (>=2) |
Version: | 0.5.0 |
Built: | 2025-10-13 22:24:31 UTC |
Source: | https://github.com/ropensci/ssarp |
Use segmented regression to create a species-area relationship (SAR) plot. The X axis represents log(island area) and the Y axis represents log(number of species)
create_sar(occurrences, npsi = 1, visualize = FALSE) create_SAR(occurrences, npsi = 1, visualize = FALSE)
create_sar(occurrences, npsi = 1, visualize = FALSE) create_SAR(occurrences, npsi = 1, visualize = FALSE)
occurrences |
The dataframe output by |
npsi |
The maximum number of breakpoints to estimate for model selection. Default: 1 |
visualize |
(boolean) Whether the plot should be displayed when the function is called. Default: FALSE |
If the user would prefer to create their own plot of the
ssarp::create_sar()
output, the aggDF
element of the returned list
includes the raw points from the plot created here. They can be accessed
as demonstrated in the Examples section.
A list of class SAR with 5 items including:
summary
: the summary output
segObj
or linObj
: the regression object (segObj
when segmented,
linObj
when linear)
aggDF
: the aggregated dataframe used to create the plot
AICscores
: the AIC scores generated during model selection
AllModels
: a list of models created in model selection, labeled by
number of breakpoints
# The GBIF key for the Anolis genus is 8782549 # Read in example dataset filtered from: # dat <- rgbif::occ_search(taxonKey = 8782549, # hasCoordinate = TRUE, # limit = 10000) dat <- read.csv(system.file("extdata", "ssarp_Example_Dat.csv", package = "ssarp")) land <- find_land(occurrences = dat) areas <- find_areas(occs = land) seg <- create_sar(occurrences = areas, npsi = 1, visualize = FALSE) plot(seg) summary <- seg$summary model_object <- seg$segObj points <- seg$aggDF
# The GBIF key for the Anolis genus is 8782549 # Read in example dataset filtered from: # dat <- rgbif::occ_search(taxonKey = 8782549, # hasCoordinate = TRUE, # limit = 10000) dat <- read.csv(system.file("extdata", "ssarp_Example_Dat.csv", package = "ssarp")) land <- find_land(occurrences = dat) areas <- find_areas(occs = land) seg <- create_sar(occurrences = areas, npsi = 1, visualize = FALSE) plot(seg) summary <- seg$summary model_object <- seg$segObj points <- seg$aggDF
Use segmented regression to create a speciation-area relationship plot. The X axis represents log(island area) and the Y axis represents log(speciation rate)
create_spar(occurrences, npsi = 1, visualize = FALSE) create_SpAR(occurrences, npsi = 1, visualize = FALSE)
create_spar(occurrences, npsi = 1, visualize = FALSE) create_SpAR(occurrences, npsi = 1, visualize = FALSE)
occurrences |
The dataframe output by one of ssarp's speciation
methods ( |
npsi |
The maximum number of breakpoints to estimate for model selection. Default: 1 |
visualize |
(boolean) Whether the plot should be displayed when the function is called. Default: FALSE |
If the user would prefer to create their own plot of the
ssarp::create_spar()
output, the aggDF
element of the returned list
includes the raw points from the plot created here. They can be accessed
as demonstrated in the Examples section.
More information about the three methods for estimating speciation rate
included in ssarp
can be found in ssarp's SpAR vignette.
A list of class SAR with 5 items including:
summary
: the summary output
segObj
or linObj
: the regression object (segObj
when segmented,
linObj
when linear)
aggDF
: the aggregated dataframe used to create the plot
AICscores
: the AIC scores generated during model selection
AllModels
: a list of models created in model selection, labeled by
number of breakpoints
# The GBIF key for the Anolis genus is 8782549 # Read in example dataset filtered from: # dat <- rgbif::occ_search(taxonKey = 8782549, # hasCoordinate = TRUE, # limit = 10000) dat <- read.csv(system.file("extdata", "ssarp_Example_Dat.csv", package = "ssarp")) 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")) occ_speciation <- estimate_ms(tree = tree, label_type = "epithet", occurrences = areas) seg <- create_spar(occurrences = occ_speciation, npsi = 1, visualize = FALSE) plot(seg) summary <- seg$summary model_object <- seg$segObj points <- seg$aggDF
# The GBIF key for the Anolis genus is 8782549 # Read in example dataset filtered from: # dat <- rgbif::occ_search(taxonKey = 8782549, # hasCoordinate = TRUE, # limit = 10000) dat <- read.csv(system.file("extdata", "ssarp_Example_Dat.csv", package = "ssarp")) 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")) occ_speciation <- estimate_ms(tree = tree, label_type = "epithet", occurrences = areas) seg <- create_spar(occurrences = occ_speciation, npsi = 1, visualize = FALSE) plot(seg) summary <- seg$summary model_object <- seg$segObj points <- seg$aggDF
Use the BAMMtools package (Rabosky et al. 2014) to extract tip speciation rates from user-supplied BAMM analysis objects.
estimate_bamm(label_type = "binomial", occurrences, edata) estimate_BAMM(label_type = "binomial", occurrences, edata)
estimate_bamm(label_type = "binomial", occurrences, edata) estimate_BAMM(label_type = "binomial", occurrences, edata)
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 "genericName" and "specificEpithet" |
edata |
The eventdata object created by using the
|
A dataframe that includes speciation rates for each species in the occurrence record dataframe
Rabosky, D.L. (2014). Automatic Detection of Key Innovations, Rate Shifts, and Diversity-Dependence on Phylogenetic Trees. PLOS ONE, 9(2): e89543.
Rabosky, D.L., Grundler, M., Anderson, C., Title, P., Shi, J.J., Brown, J.W., Huang, H., & Larson, J.G. (2014), BAMMtools: an R package for the analysis of evolutionary dynamics on phylogenetic trees. Methods in Ecology and Evolution, 5: 701-707.
# The GBIF key for the Anolis genus is 8782549 # Read in example dataset filtered from: # dat <- rgbif::occ_search(taxonKey = 8782549, # hasCoordinate = TRUE, # limit = 10000) dat <- read.csv(system.file("extdata", "ssarp_Example_Dat.csv", package = "ssarp")) 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 <- estimate_bamm(label_type = "epithet", occurrences = areas , edata = edata)
# The GBIF key for the Anolis genus is 8782549 # Read in example dataset filtered from: # dat <- rgbif::occ_search(taxonKey = 8782549, # hasCoordinate = TRUE, # limit = 10000) dat <- read.csv(system.file("extdata", "ssarp_Example_Dat.csv", package = "ssarp")) 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 <- estimate_bamm(label_type = "epithet", occurrences = areas , edata = edata)
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).
estimate_dr(tree, label_type = "binomial", occurrences) estimate_DR(tree, label_type = "binomial", occurrences)
estimate_dr(tree, label_type = "binomial", occurrences) estimate_DR(tree, label_type = "binomial", occurrences)
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 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 "genericName" and "specificEpithet" |
This function uses methodology from Sun and Folk (2020) to calculate the DR statistic for each tip of a given tree 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). The tree read in the examples below is modified from Patton et al. (2021).
A dataframe that includes speciation rates for each species in the occurrence record dataframe
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.
Jetz, W., Thomas, G.H, Joy, J.B., Harmann, K., & Mooers, A.O. (2012). The global diversity of birds in space and time. Nature, 491: 444-448.
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.
Quintero, I., & Jetz, W. (2018). Global elevational diversity and diversification of birds. Nature, 555, 246–250.
Sun, M. & Folk, R.A. (2020). Cactusolo/rosid_NCOMMS-19-37964-T: Code and data for rosid_NCOMMS-19-37964 (Version V.1.0). Zenodo. http://doi.org/10.5281/zenodo.3843441
Title P.O. & Rabosky D.L. (2019). Tip rates, phylogenies and diversification: What are we estimating, and how good are the estimates? Methods in Ecology and Evolution. 10: 821–834.
# The GBIF key for the Anolis genus is 8782549 # Read in example dataset filtered from: # dat <- rgbif::occ_search(taxonKey = 8782549, # hasCoordinate = TRUE, # limit = 10000) dat <- read.csv(system.file("extdata", "ssarp_Example_Dat.csv", package = "ssarp")) 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")) occ_speciation <- estimate_dr(tree = tree, label_type = "epithet", occurrences = areas)
# The GBIF key for the Anolis genus is 8782549 # Read in example dataset filtered from: # dat <- rgbif::occ_search(taxonKey = 8782549, # hasCoordinate = TRUE, # limit = 10000) dat <- read.csv(system.file("extdata", "ssarp_Example_Dat.csv", package = "ssarp")) 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")) occ_speciation <- estimate_dr(tree = tree, label_type = "epithet", occurrences = areas)
Use methodology from Magallón 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)
estimate_ms(tree, label_type = "binomial", occurrences) estimate_MS(tree, label_type = "binomial", occurrences)
estimate_ms(tree, label_type = "binomial", occurrences) estimate_MS(tree, label_type = "binomial", occurrences)
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 "specificEpithet", "genericName", and "areas" |
A dataframe that includes speciation rates for each island in the user-provided occurrence record dataframe.
Magallón, S. & Sanderson, M.J. (2001). Absolute Diversification Rates in Angiosperm Clades. Evolution, 55(9): 1762-1780.
# The GBIF key for the Anolis genus is 8782549 # Read in example dataset filtered from: # dat <- rgbif::occ_search(taxonKey = 8782549, # hasCoordinate = TRUE, # limit = 10000) dat <- read.csv(system.file("extdata", "ssarp_Example_Dat.csv", package = "ssarp")) 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")) occ_speciation <- estimate_ms(tree = tree, label_type = "epithet", occurrences = areas)
# The GBIF key for the Anolis genus is 8782549 # Read in example dataset filtered from: # dat <- rgbif::occ_search(taxonKey = 8782549, # hasCoordinate = TRUE, # limit = 10000) dat <- read.csv(system.file("extdata", "ssarp_Example_Dat.csv", package = "ssarp")) 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")) occ_speciation <- estimate_ms(tree = tree, label_type = "epithet", occurrences = areas)
Find the areas of the land masses relevant to the taxon of interest with two options: a database of island names and areas, or a user-provided shapefile.
find_areas(occs, area_custom = NULL, shapefile = NULL, names = NULL)
find_areas(occs, area_custom = NULL, shapefile = NULL, names = NULL)
occs |
The dataframe that is returned by |
area_custom |
A dataframe including names of land masses and their associated areas. This dataframe should be provided when the user would like to bypass using the built-in database of island names and areas. Please ensure that the custom dataframe includes the land mass's area in a column called "AREA" and the name in a column called "Name". (Optional) |
shapefile |
A shapefile (.shp) containing spatial information for the geographic locations of interest. (Optional) |
names |
If the user would like to restrict which polygons in the shapefile are included in the returned occurrence record dataframe, they can be specified here as a vector. If the user does not provide a vector, all of the non-NA names in the shapefile will be included (as found in shapefile$name). (Optional) |
The first method is to reference a built-in dataset of island names and areas to find the areas of the landmasses relevant to the taxon of interest. The user may also decide to input their own custom dataframe including names of relevant land masses and their associated areas to bypass using ssarp's built-in dataset.
The second method is to reference a user-supplied shapefile containing spatial information for the landmasses of interest in order to determine their areas.
While the word "landmasses" was used heavily in this documentation, users supplying their own custom area dataframe or shapefile are encouraged to use this function in the ssarp workflow to create species- and speciation- area relationships for island-like systems such as lakes, fragmented habitat, and mountain peaks.
A dataframe of the species name, island name, and island area
# The GBIF key for the Anolis genus is 8782549 # Read in example dataset filtered from: # dat <- rgbif::occ_search(taxonKey = 8782549, # hasCoordinate = TRUE, # limit = 10000) dat <- read.csv(system.file("extdata", "ssarp_Example_Dat.csv", package = "ssarp")) occs <- find_land(occurrences = dat) areas <- find_areas(occs = occs)
# The GBIF key for the Anolis genus is 8782549 # Read in example dataset filtered from: # dat <- rgbif::occ_search(taxonKey = 8782549, # hasCoordinate = TRUE, # limit = 10000) dat <- read.csv(system.file("extdata", "ssarp_Example_Dat.csv", package = "ssarp")) occs <- find_land(occurrences = dat) areas <- find_areas(occs = occs)
Use various mapping tools to attempt to find the names of land masses where the occurrence points were found.
find_land(occurrences, fillgaps = FALSE)
find_land(occurrences, fillgaps = FALSE)
occurrences |
A dataframe output by |
fillgaps |
(logical) Attempt to use Photon API to fill in gaps left by
|
A dataframe of the species name, longitude, latitude, and three parts of occurrence information. "first" is the name used to describe the largest possible area of land where the occurrence point is found. "second" is the name used to describe the second-largest possible area of land that corresponds with the occurrence point. "third" is the most specific area of land that corresponds with the occurrence point. Functions later in the ssarp pipeline default to checking whether "third" has an entry, then look at "second," and then "first."
# The GBIF key for the Anolis genus is 8782549 # Read in example dataset filtered from: # dat <- rgbif::occ_search(taxonKey = 8782549, # hasCoordinate = TRUE, # limit = 10000) dat <- read.csv(system.file("extdata", "ssarp_Example_Dat.csv", package = "ssarp")) occs <- find_land(occurrences = dat, fillgaps = FALSE)
# The GBIF key for the Anolis genus is 8782549 # Read in example dataset filtered from: # dat <- rgbif::occ_search(taxonKey = 8782549, # hasCoordinate = TRUE, # limit = 10000) dat <- read.csv(system.file("extdata", "ssarp_Example_Dat.csv", package = "ssarp")) occs <- find_land(occurrences = dat, fillgaps = FALSE)
Use a presence-absense matrix (PAM) to create a dataframe that can be
used to generate a species-area relationship (SAR) or speciation-area
relationship (SpAR) in the ssarp
pipeline.
find_pam_areas(pam, area_custom = NULL)
find_pam_areas(pam, area_custom = NULL)
pam |
A presence-absence matrix (PAM), saved as a dataframe. Please ensure that the PAM has species names (include both generic name and specific epithet, with an underscore separating them) as the column names, with the exception of the first column that designates locations, which must be named "Island". |
area_custom |
A dataframe including names of land masses and their associated areas. This dataframe should be provided when the user would like to bypass using the built-in database of island names and areas. Please ensure that the custom dataframe includes the land mass's area in a column called "AREA" and the name in a column called "Name". (Optional) |
PAMs summarize the occurrence of species across different geographic locations. The column names of a PAM are species names, with the exception of the first column, which specifies the name of locations. For each cell corresponding to a species/location pair, either a 1 (presence) or a 0 (absence) is input depending on whether the species can be found at that location or not.
Using a PAM, this function will find the areas of the land masses relevant to the taxon of interest with two options: a built-in database of island names and areas, or a user-provided list of island names and areas.
The default method is to reference a built-in dataset of island names
and areas to find the areas of the landmasses relevant to the taxon of
interest. The user may also decide to input their own custom dataframe
including names of relevant land masses and their associated areas to
bypass using ssarp
's built-in dataset.
While the word "landmasses" was used heavily in this documentation, users
supplying their own custom area dataframe or shapefile are encouraged to
use this function in the ssarp
workflow to create species- and speciation-
area relationships for island-like systems such as lakes, fragmented habitat,
and mountain peaks.
A dataframe of species names, island names, and island areas
pam <- read.csv(system.file("extdata", "example_pam.csv", package = "ssarp")) areas <- find_pam_areas(pam = pam)
pam <- read.csv(system.file("extdata", "example_pam.csv", package = "ssarp")) areas <- find_pam_areas(pam = pam)
In order to address an R CMD check warning about non-ASCII characters in the island_area object, these characters in the island names had to be converted to an ASCII format. The non-ASCII accents in the island names are important for the functionality of the ssarp package, so this function provides the user with a dataframe including the original, un-converted island names.
get_island_areas()
get_island_areas()
An edited version of the ssarp::island_areas
object, which is a
dataframe including the names, areas, and maximum elevations of islands
from across the globe.
island_df <- get_island_areas()
island_df <- get_island_areas()
Use a dataframe output by ssarp::find_areas()
to determine which species
occur on specific islands by creating a presence-absence dataframe. A 1
represents presence and a 0 represents absence.
get_presence_absence(occs)
get_presence_absence(occs)
occs |
The dataframe output by
|
A dataframe with a row for each island in the given occurrence record dataframe and a column for each species. Within each species column, a 1 represents the presence of that species on the island corresponding to the given row, and a 0 represents the absence of that species on the island corresponding to the given row.
# The GBIF key for the Anolis genus is 8782549 # Read in example dataset filtered from: # dat <- rgbif::occ_search(taxonKey = 8782549, # hasCoordinate = TRUE, # limit = 10000) dat <- read.csv(system.file("extdata", "ssarp_Example_Dat.csv", package = "ssarp")) land <- find_land(occurrences = dat) areas <- find_areas(occs = land) pres_abs <- get_presence_absence(areas)
# The GBIF key for the Anolis genus is 8782549 # Read in example dataset filtered from: # dat <- rgbif::occ_search(taxonKey = 8782549, # hasCoordinate = TRUE, # limit = 10000) dat <- read.csv(system.file("extdata", "ssarp_Example_Dat.csv", package = "ssarp")) land <- find_land(occurrences = dat) areas <- find_areas(occs = land) pres_abs <- get_presence_absence(areas)
Use a dataframe output by ssarp::find_areas()
to determine how many
species occur on each island by creating a species richness dataframe.
get_richness(occs)
get_richness(occs)
occs |
The dataframe output by
|
The output of this function can be used directly with
the sars R package
to fit additional SAR models that ssarp
does not create itself.
A dataframe with two columns: the first containing island areas and the second containing the associated species richness (number of unique species)
# The GBIF key for the Anolis genus is 8782549 # Read in example dataset filtered from: # dat <- rgbif::occ_search(taxonKey = 8782549, # hasCoordinate = TRUE, # limit = 10000) dat <- read.csv(system.file("extdata", "ssarp_Example_Dat.csv", package = "ssarp")) land <- find_land(occurrences = dat) areas <- find_areas(occs = land) richness <- get_richness(occs = areas)
# The GBIF key for the Anolis genus is 8782549 # Read in example dataset filtered from: # dat <- rgbif::occ_search(taxonKey = 8782549, # hasCoordinate = TRUE, # limit = 10000) dat <- read.csv(system.file("extdata", "ssarp_Example_Dat.csv", package = "ssarp")) land <- find_land(occurrences = dat) areas <- find_areas(occs = land) richness <- get_richness(occs = areas)
When using data obtained via rgbif::occ_search()
and filtered with
ssarp::find_areas()
for a publication, you must keep a record of the
datasets used in your analysis. This function assists in creating the
dataframe necessary to follow GBIF's citation guidelines (see References).
get_sources(occs)
get_sources(occs)
occs |
The occurrence record dataframe returned by |
A dataframe of dataset keys and the number of occurrence records
associated with each key that were gathered with rgbif::occ_search()
and/or
filtered with ssarp::find_areas()
.
Data obtained via rgbif::occ_search()
and filtered with
ssarp::find_areas()
falls under the derived datasets distinction
# The GBIF key for the Anolis genus is 8782549 # Read in example dataset filtered from: # dat <- rgbif::occ_search(taxonKey = 8782549, # hasCoordinate = TRUE, # limit = 10000) dat <- read.csv(system.file("extdata", "ssarp_Example_Dat.csv", package = "ssarp")) source_df <- get_sources(occs = dat)
# The GBIF key for the Anolis genus is 8782549 # Read in example dataset filtered from: # dat <- rgbif::occ_search(taxonKey = 8782549, # hasCoordinate = TRUE, # limit = 10000) dat <- read.csv(system.file("extdata", "ssarp_Example_Dat.csv", package = "ssarp")) source_df <- get_sources(occs = dat)
A collection of island names, their areas, and their elevations found using ArcGIS
island_areas
island_areas
A data frame with 26376 rows and 5 variables:
OBJECTID_1
integer Object ID from ArcGIS
COUNT
integer Number of cells within island, from ArcGIS
AREA
double Area of the island
MAX
integer Maximum elevation of the island
Name
character Name of the island
Function for plotting species-area relationship objects from the
ssarp::create_SAR()
function
## S3 method for class 'SAR' plot(x, ...)
## S3 method for class 'SAR' plot(x, ...)
x |
The SAR object that will be plotted |
... |
Parameters to pass to plot() |
A plot of your species-area relationship
# The GBIF key for the Anolis genus is 8782549 # Read in example dataset filtered from: # dat <- rgbif::occ_search(taxonKey = 8782549, # hasCoordinate = TRUE, # limit = 10000) dat <- read.csv(system.file("extdata", "ssarp_Example_Dat.csv", package = "ssarp")) occs <- find_land(occurrences = dat) areas <- find_areas(occs = occs) seg <- create_SAR(areas, npsi = 0) plot(seg)
# The GBIF key for the Anolis genus is 8782549 # Read in example dataset filtered from: # dat <- rgbif::occ_search(taxonKey = 8782549, # hasCoordinate = TRUE, # limit = 10000) dat <- read.csv(system.file("extdata", "ssarp_Example_Dat.csv", package = "ssarp")) occs <- find_land(occurrences = dat) areas <- find_areas(occs = occs) seg <- create_SAR(areas, npsi = 0) plot(seg)
Function for printing the summary of species-area relationship objects from
the ssarp::create_SAR()
function
## S3 method for class 'SAR' print(x, printlen = NULL, ...)
## S3 method for class 'SAR' print(x, printlen = NULL, ...)
x |
The SAR object of interest |
printlen |
Should always be NULL |
... |
Parameters to pass to print() |
The summary of your species-area relationship
# The GBIF key for the Anolis genus is 8782549 # Read in example dataset filtered from: # dat <- rgbif::occ_search(taxonKey = 8782549, # hasCoordinate = TRUE, # limit = 10000) dat <- read.csv(system.file("extdata", "ssarp_Example_Dat.csv", package = "ssarp")) occs <- find_land(occurrences = dat) areas <- find_areas(occs = occs) seg <- create_SAR(areas, npsi = 0) print(seg)
# The GBIF key for the Anolis genus is 8782549 # Read in example dataset filtered from: # dat <- rgbif::occ_search(taxonKey = 8782549, # hasCoordinate = TRUE, # limit = 10000) dat <- read.csv(system.file("extdata", "ssarp_Example_Dat.csv", package = "ssarp")) occs <- find_land(occurrences = dat) areas <- find_areas(occs = occs) seg <- create_SAR(areas, npsi = 0) print(seg)
Reference a list of continental areas to remove them from the dataframe
output by ssarp::find_areas()
.
remove_continents(occs)
remove_continents(occs)
occs |
The dataframe that is returned by |
A dataframe of the species name, island name, and island area (without continents)
# The GBIF key for the Anolis genus is 8782549 # Read in example dataset filtered from: # dat <- rgbif::occ_search(taxonKey = 8782549, # hasCoordinate = TRUE, # limit = 10000) dat <- read.csv(system.file("extdata", "ssarp_Example_Dat.csv", package = "ssarp")) occs <- find_land(occurrences = dat) areas <- find_areas(occs = occs) new_areas <- remove_continents(areas)
# The GBIF key for the Anolis genus is 8782549 # Read in example dataset filtered from: # dat <- rgbif::occ_search(taxonKey = 8782549, # hasCoordinate = TRUE, # limit = 10000) dat <- read.csv(system.file("extdata", "ssarp_Example_Dat.csv", package = "ssarp")) occs <- find_land(occurrences = dat) areas <- find_areas(occs = occs) new_areas <- remove_continents(areas)