Retrieve species occurrence records within an Area of Interest
get_records.Rd
This function retrieves species occurrence records from specified data providers within a given area of interest (AOI). The records are returned as an `sf` object, optionally with duplicates removed based on geometry. This function is a wrapper of the occ function from the spocc package.
Usage
get_records(species, aoi_sf, providers = NULL,
limit = 500, remove_duplicates = FALSE, date = NULL)
Arguments
- species
A character vector of species names to query.
- aoi_sf
An `sf` object representing the area of interest.
- providers
A character vector of data providers to query (e.g., "gbif", "inat").
- limit
An integer specifying the maximum number of records to retrieve from each provider. Default is 500.
- remove_duplicates
A logical value indicating whether to remove duplicate geometries from the resulting `sf` object. Default is FALSE.
- date
A character vector of length 2 specifying the date range (e.g., c("YYYY-MM-DD", "YYYY-MM-DD")). Records outside this range will be excluded.
Value
An `sf` object containing the species occurrence records that fall within the specified AOI and meet the query criteria. Returns `NULL` if no records are found or if there are issues with the input.
Examples
if (FALSE) { # \dontrun{
nc <- sf::st_read(system.file("shape/nc.shp", package="sf"))
records <- get_records(species = "Lynx rufus", nc, providers = c("gbif", "inat"))
} # }