params_manager is an R6 base class for managing hierarchical
configuration parameters. It supports:
Built‑in default settings defined by subclasses
Optional overrides via a YAML configuration file
Programmatic overrides via named arguments
Nested key access using
$syntax or character vectors
The class is designed to be inherited by specialized configuration classes (e.g., for scrapers or API clients) and provides a consistent, validated mechanism for reading, updating, and exporting configuration settings.
Format
An R6::R6Class generator object.
Features
YAML read/write support (via the yaml package)
Path syntax support:
"a$b$c"orc("a","b","c")Nested configuration updating with validation at the top-level key
Export of defaults or current configuration to a YAML file
Methods
Method new()
Initialize the parameter manager.
This loads configuration using the following precedence:
Defaults defined by the subclass
YAML configuration file (if provided)
Programmatic overrides via
...
Usage
params_manager$new(config_file = NULL, ...)Method get()
Retrieve a configuration value (supports nested paths).
Nested syntax examples:
"selenium$host""robots$check"c("selenium", "port")
Method set()
Updates configuration.
If
keyis a top-level name*, only the specific element is modified.If
keyis a nested path* (e.g., "x.y" / "x$y" / c("x","y")),
the method updates only that nested value. In both cases, the relevant
top-level key is validated via private$.validate().
Method update()
Recursively update configuration values from a (possibly nested) list.
Only top-level keys contained in values are validated.