eval.config: Read from the currently active configuration...

Description Usage Arguments Value See Also Examples

View source: R/read.R

Description

Read from the currently active configuration (JSON/INI/YAML/TOML be supported), 'retreiving either a single named value or all values as a config obj which have 'config', 'configtype', 'file' 'property.

Usage

1
2
3
4
5
6
eval.config(
  value = NULL,
  config = Sys.getenv("R_CONFIG_ACTIVE", "default"),
  file = Sys.getenv("R_CONFIGFILE_ACTIVE", "config.cfg"),
  ...
)

Arguments

value

Name of value (NULL to read all values)

config

Name of configuration to read from. Default is the value of 'the R_CONFIG_ACTIVE environment variable (Set to 'default' if the variable does not exist).

file

File name of configuration file to read from. Defaults to the value of the 'R_CONFIGFILE_ACTIVE' environment variable ('config.cfg' if the variable does not exist and JSON/INI/YAML/TOML format only)

...

Arguments for read.config

Value

Either a single value or all values as a list or logical FALSE indicating that is not standard JSON/INI/YAML/TOML format file

See Also

read.config read config by this

eval.config.merge which can merge multiple parameter sets by sections

Examples

1
2
3
4
5
6
config.json <- system.file('extdata', 'config.json', package='configr')
config <- eval.config(file=config.json)
config.extra.parsed.1 <- eval.config(file = config.json, extra.list = list(debug = 'TRUE'))
other.config <- system.file('extdata', 'config.other.yaml', package='configr')
config.extra.parsed.2 <- eval.config(file = config.json, extra.list = list(debug = 'TRUE'), 
other.config = other.config)

configr documentation built on July 17, 2020, 5:07 p.m.