Skip to contents

Searches the plausible database locations and returns the path to the first duckdb file that exists.

Usage

findDatabase(dbName = NULL, folder = "IMR_biotic_BES_database")

Arguments

dbName

Character string or NULL giving the name of the database file without the .duckdb extension. If NULL uses the default name ("bioticexplorer").

folder

Character string giving the name of the database folder inside the user's home directory. Defaults to "IMR_biotic_BES_database".

Value

Character string giving the absolute path to an existing .duckdb file, or NULL if no database was found.

Details

Checks dbPathCandidates in order, so a database installed to the current default takes precedence over one left in the location that raw ~ expansion produced on Windows. Intended for downstream code, such as BioticExplorer, which has to find a database it did not compile itself.

Author

Mikko Vihtakari (Institute of Marine Research)

Examples

findDatabase()
#> NULL