Helper function: GBIF data retrieval
fetch_gbif_data.RdRetrieves occurrence data from GBIF based on country, date range, and basisOfRecord.
Usage
fetch_gbif_data(
country,
date_range,
basis_of_record = "MATERIAL_SAMPLE",
area_bounds = NULL,
scientific_name = NULL,
mode = c("auto", "search", "download"),
max_rows = 30000
)Arguments
- country
Character string specifying the country (e.g. "Greece", "Norway").
- date_range
A Date vector of length 2 specifying start and end dates.
- basis_of_record
Character vector of GBIF basisOfRecord values.
- area_bounds
Optional list with
west,east,south, andnorth.- scientific_name
Optional scientific name filter. If
NULLor empty, no scientific name filter is applied.- mode
GBIF retrieval mode:
"auto","search", or"download". Auto usesocc_downloadfor broad queries when credentials are available, otherwise falls back toocc_search.- max_rows
Maximum number of GBIF rows to fetch/return when using
occ_search. Set high by default for unrestricted loading.