Skip to content

Generates presence-absence points for a species over a specified AOI using H3 hexagons. Retrieves occurrence records, aggregates them by hexagon, and samples pseudo-absences.

Usage

h3sdm_pa(
  species,
  aoi_sf,
  res = 6,
  n_neg = 500,
  providers = NULL,
  remove_duplicates = FALSE,
  date = NULL,
  limit = 500,
  expand_factor = 0.1
)

Arguments

species

Character. Species name.

aoi_sf

sf polygon of the area of interest (AOI).

res

Integer. H3 resolution (1–16). Default 6.

n_neg

Integer. Number of pseudo-absence hexagons to sample. Default 500.

providers

Character vector of data sources (e.g., "gbif").

remove_duplicates

Logical. Remove duplicate geometries. Default FALSE.

date

Character vector c("start","end") to filter by date.

limit

Integer. Maximum number of occurrence records to download. Default 500.

expand_factor

Numeric. Expand AOI bbox for full hex coverage. Default 0.1.

Value

sf object with columns h3_address, presence (factor 0/1), and geometry.

Examples

if (FALSE) { # \dontrun{
cr <- sf::st_read(system.file("shape/nc.shp", package="sf"))
rec_sf <- h3sdm_pa("Lynx rufus", cr, res = 6, n_neg = 300, limit = 1000)
} # }