As an alternative to reading FLUXNET data into memory with
flux_read(),
this ingests all FLUXNET data into a DuckDB database that can be queried in R
with dplyr via dbplyr. This is especially useful for daily and hourly
data which are likely to overflow memory when trying to read them in with
flux_read().
Usage
flux_db_build(
manifest,
duckdb_path = Sys.getenv("FLUXNET_DB_PATH", unset = "fluxnet/fluxnet.duckdb")
)Arguments
- manifest
A file manifest tibble created by
flux_discover_files().- duckdb_path
File path to a .duckdb file used to store FLUXNET data. Can be set with the environment variable
FLUXNET_DB_PATH.
Examples
if (FALSE) { # \dontrun{
# Ingest all available data into a DuckDB database
manifest <- flux_discover_files()
flux_db_build(manifest)
} # }