Connects to a frozen CalCOFI DuckLake release. Downloads and caches the database locally for fast subsequent access.
cc_get_db(
version = "latest",
local_cache = TRUE,
cache_dir = NULL,
refresh = FALSE
)Version string (e.g., "v2026.02") or "latest" (default)
Use local cache if available (default: TRUE)
Directory for local cache. Default uses
rappdirs::user_cache_dir("calcofi4r") if rappdirs is installed,
otherwise a temp directory.
Force re-download even if cached (default: FALSE)
DuckDB connection object
The frozen releases contain clean, stable data without provenance columns,
suitable for analysis and visualization. Use cc_list_versions() to
see available releases.
The connection points to Parquet files from the frozen release, which are registered as views in DuckDB. This allows querying the data without downloading the entire database.
Data is stored at gs://calcofi-db/ducklake/releases/{version}/.
if (FALSE) { # \dontrun{
# connect to latest release
con <- cc_get_db()
DBI::dbListTables(con)
# connect to specific version
con <- cc_get_db(version = "v2026.02")
# query data
DBI::dbGetQuery(con, "SELECT COUNT(*) FROM larvae")
} # }