Skip to contents

Main ETL to ingest WA+ modeled result sets found at location defined by getOption("wa.data"). This location may be specified at run time or via environment variable WA_DATA. Exact location and structure for output data files are still to be defined.

Usage

data_etl(
  iso3 = NULL,
  root = getOption("wa.data"),
  file = file.path("./data-raw/rds/data.rds")
)

Arguments

iso3

3-letter country code of the river basin to ingest. If null, all basin ISO3 listed in ISO3 will be processed. Can be used to manually test new result sets.

root

base directory (local or remote) to scan for input data files (default: package option getOption("wa.data") or environment variable WA_DATA if set)

file

a connection or the name of the file where the R object is saved to. The default behavior is to save the transformed dataset to this package's ./data-raw folder, and to include it as a built-in package dataset (this is done automatically on package build, see DATA).

Value

normalized data.table with variables: -

Details

A vignette is available to describe the current approach.

Examples

data <- data_etl("mli")
#> Error in formal.args[[as.character(substitute(arg))]]: no such index at level 1