compileDatabase: Download IMR Biotic database and to place it into a duckdb...

View source: R/compileDatabase.R

compileDatabaseR Documentation

Download IMR Biotic database and to place it into a duckdb database

Description

Downloads, formulates and indexes IMR Biotic database into a format used by BioticExplorer

Usage

compileDatabase(
  years = 1900:data.table::year(Sys.time()),
  dbPath = "~/IMR_biotic_BES_database",
  dbIndexFile = file.path(dbPath, "dbIndex.rda"),
  dbName = NULL,
  overwrite = FALSE
)

Arguments

years

Vector of integers specifying the years to be downloaded. The database reaches 1914:year(Sys.Date())

dbPath

Character string specifying the folder where the duckdb and dbIndex files should be saved.

dbIndexFile

Character string specifying the file path where the index of the database should be saved. Must include .rda at the end. The index is used by BioticExplorer.

dbName

Character string or NULL. If NULL uses the default names ("bioticexploer").

overwrite

Logical indicating whether existing information in the duckdb database (dbPath) should be downloaded again and overwritten.

Details

Runs the prepareCruiseSeriesList, prepareGearList, downloadDatabase and indexDatabase functions, and saves the results into a duckdb. Be aware that running these functions requires access to the IMR intranet and reasonably stable internet. It is advisable to run the function in a separate R session or in a screen session in the terminal on Unix machines, as downloading the database takes several hours and requires a stable internet connection. If the connection is unstable, the function may return an error. In such cases, ensure that the connection is stable and rerun the function. The function should continue downloading from where it left off.

Author(s)

Mikko Vihtakari, Ibrahim Umar (Institute of Marine Research)


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