downloadDatabase: Download and parse NMD data for the BioticExplorer database

View source: R/downloadDatabase.R

downloadDatabaseR Documentation

Download and parse NMD data for the BioticExplorer database

Description

Downloads annual NMD data from the API and writes them as a DuckDB database

Usage

downloadDatabase(
  years,
  connection,
  icesAreas = icesAreas,
  cruiseSeries = cruiseSeries,
  gearCodes = gearCodes,
  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_polygon abject. 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.

Details

The function downloads NMD data from the API per year, saves these in temp files, reformats them for the DuckDB and writes them into the database.

Author(s)

Ibrahim Umar, Mikko Vihtakari (Institute of Marine Research)


MikkoVihtakari/BioticExplorerServer documentation built on Feb. 28, 2025, 11:23 p.m.