eval.config.merge: Merge config parameter sets by sections.

Description Usage Arguments Value See Also Examples

View source: R/merge.R

Description

Merge config parameter sets by sections.

Usage

1
2
eval.config.merge(file = Sys.getenv("R_CONFIGFILE_ACTIVE", "config.cfg"),
  sections = NULL, ...)

Arguments

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)

sections

Need be merged parameter sets, eg. sections=c('default', 'version'), will default to all of config sections

...

Arguments for get.config.type, eval.config.sections, eval.config

Value

A list or logical FALSE indicating that is not standard JSON/INI/YAML/TOML format file

See Also

eval.config.sections which only get all of the mainly parameter sets name in config file, read.config which only read from a config as a list, eval.config which only read one sections as config obj or a value from config file.

Examples

1
2
3
4
5
6
7
8
config.json <- system.file('extdata', 'config.json', package='configr')
config.ini <- system.file('extdata', 'config.ini', package='configr')
config.yaml <- system.file('extdata', 'config.yaml', package='configr')
config.toml <- system.file('extdata', 'config.toml', package='configr')
eval.config.merge(config.json)
eval.config.merge(config.ini)
eval.config.merge(config.yaml)
eval.config.merge(config.toml)

Miachol/configr documentation built on May 4, 2018, 9:17 a.m.