Generates a hexagonal grid over the AOI, assigns species presence records to hexagons, and samples pseudo-absences from hexagons with no records.
Usage
h3sdm_pa(
species,
aoi_sf,
res = 6,
n_pseudoabs = 500,
providers = NULL,
remove_duplicates = FALSE,
date = NULL,
limit = 500,
expand_factor = 0.1
)Arguments
- species
characterSpecies name (single string) for which records are requested.- aoi_sf
sfAOI (area of interest) polygon.- res
integerH3 resolution for the hexagonal grid.- n_pseudoabs
integerNumber of pseudo-absence hexagons to sample.- providers
characterOptional vector of data providers (e.g., "gbif", "inat").- remove_duplicates
logicalRemove duplicate records at the same coordinates.- date
characterOptional date filter for records.- limit
integerMaximum number of records to download.- expand_factor
numericFactor to expand AOI before creating hex grid.
Value
sf object with columns:
h3_address: H3 index of the hexagon.presence: factor with levels "0" (pseudo-absence) and "1" (presence).geometry: MULTIPOLYGON of each hexagon.
Examples
# \donttest{
data(cr_outline_c, package = "h3sdm")
dataset <- h3sdm_pa("Agalychnis callidryas", cr_outline_c, res = 7, n_pseudoabs = 100)
# }