convert.config {configr}R Documentation

Covert configuration file from JSON/INI/YAML/TOML to JSON/INI/YAML

Description

Covert configuration file from JSON/INI/YAML/TOML to JSON/INI/YAML

Usage

convert.config(
  file = Sys.getenv("R_CONFIGFILE_ACTIVE", "config.cfg"),
  out.file = Sys.getenv("R_CONFIGFILE_ACTIVE", "config.cfg"),
  convert.to = "ini",
  ...
)

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)

out.file

Output path of configuration file. Defaults to the value of the 'R_CONFIGFILE_ACTIVE' environment variable ('config.cfg' if the variable does not exist)

convert.to

JSON/INI/YAML

...

Arguments for read.config and write.config

Value

Logical indicating whether convert success

See Also

fromJSON JSON file will read by this

read.ini INI file will read by this

yaml.load_file YAML file will read by this

Examples

config.json <- system.file('extdata', 'config.json', package='configr')
config <- convert.config(file=config.json, out.file = sprintf('%s/config.ini', tempdir()))

[Package configr version 0.3.5 Index]