is.toml.file {configr}R Documentation

Function to check wheather file is TOML format

Description

Function to check wheather file is TOML format

Usage

is.toml.file(
  file = Sys.getenv("R_CONFIGFILE_ACTIVE", "config.cfg"),
  toml.file.debug = FALSE,
  ...
)

Arguments

file

File name of configuration file to test. 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)

toml.file.debug

If TRUE, it will show error infomation when read TOML config, default is FALSE

...

Arguments for parseTOML

Value

Logical indicating whether the specified configuration file is TOML format

See Also

is.json.file is.ini.file, is.yaml.file

Examples

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')
print(is.toml.file(config.json))
print(is.toml.file(config.ini))
print(is.toml.file(config.yaml))
print(is.toml.file(config.toml))

[Package configr version 0.3.5 Index]