Skip to contents

Returns the platform-appropriate default folder for the duckdb database compiled by compileDatabase.

Usage

defaultDbPath(folder = "IMR_biotic_BES_database")

Arguments

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 an absolute path to the default database folder. The folder is not created.

Details

On macOS and Linux the default is ~/IMR_biotic_BES_database. On Windows, R expands ~ through the "personal"/Documents special folder, which OneDrive's Known Folder Move frequently redirects into a synchronized OneDrive - <Organization>\Documents folder. A multi-gigabyte DuckDB file does not belong in a cloud-synchronized folder, and the redirection made the documented default resolve to different real locations depending on the machine. The default therefore resolves to %USERPROFILE%\IMR_biotic_BES_database on Windows, matching the convention documented by BAIT. If USERPROFILE is not set, the function falls back to ~ expansion.

See also

dbPathCandidates and findDatabase for locating a database that was installed to either of the two historical Windows locations.

Author

Mikko Vihtakari (Institute of Marine Research)

Examples

defaultDbPath()
#> [1] "/home/runner/IMR_biotic_BES_database"