Skip to contents

Sets up the root directory for all pipeline outputs, using environment or fallback.

Usage

update_data_root(settings, data_root = NULL, create_data_root = TRUE)

Arguments

settings

list. Settings object to update.

data_root

character. Optional explicit path to data root directory.

create_data_root

logical. If TRUE (default), creates data root if missing.

Value

list. Settings object with data_root set.

Details

  • Centralizes all project outputs for reproducibility and easy cleanup.

  • Uses WEIGHTING_DATA_PATH env var if set, else tempdir().

  • Converts relative paths to absolute, handles test environments.

  • Creates directory if missing (optional).

  • Stops with error if directory cannot be created.

Examples

## Not run:
Sys.setenv(WEIGHTING_DATA_PATH = tempdir())
update_data_root(list(), data_root = "test_cache")
#> Error in update_data_root(list(), data_root = "test_cache"): could not find function "update_data_root"
## End(Not run)