Download and parse NMD Biotic data to files
Source:R/downloadDatabaseToFiles.R
downloadDatabaseToFiles.RdDownloads annual NMD Biotic data from the API and saves them as XML and/or RDS files on disk. Unlike downloadDatabase, this function does not write to a DuckDB database.
Usage
downloadDatabaseToFiles(
years,
dest,
method = "compare",
save = c("xml", "rds"),
icesAreas = NULL,
cruiseSeries = NULL,
gearCodes = NULL
)Arguments
- years
Vector of integers specifying the years to be downloaded. The database reaches 1914:year(Sys.Date())
- dest
Character string specifying the folder path where downloaded files should be saved. Subdirectories
XMLfiles/andRdata/are created automatically.- method
Character string controlling what to do when a file already exists.
"compare"(default) re-downloads and overwrites;"keep"skips existing files.- save
Character vector of output formats. Can include
"xml"(raw XML, always saved) and/or"rds"(parsedbioticToDatabaseoutput as RDS).- 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.