Download and parse NMD data for the BioticExplorer database
Source:R/downloadDatabase.R
downloadDatabase.RdDownloads annual NMD data from the API and writes them as a DuckDB database
Usage
downloadDatabase(
years,
connection,
icesAreas = NULL,
cruiseSeries = NULL,
gearCodes = NULL,
overwrite = FALSE
)Arguments
- years
Vector of integers specifying the years to be downloaded. The database reaches 1914:year(Sys.Date())
- connection
Object defining the duckdb connection. Typically made within
compileDatabase.- icesAreas
ICES area shape
st_polygonabject. Used for calculating the ICES area for a specific fishstation.- cruiseSeries
a data.table object of NMD cruise series list. Used to identify cruise series of a specific mission. See
prepareCruiseSeriesList.- gearCodes
a data.table object of NMD gear code list. Used to make gearname and gearcategory columns. See
prepareGearList.- overwrite
Logical indicating whether existing information in the duckdb database (
dbPath) should be downloaded again and overwritten.
Value
Called for its side effects: appends parsed Biotic data to the DuckDB database. Returns NULL invisibly.