is.yaml.file: Function to check wheather file is YAML format

View source: R/configtype.R

is.yaml.fileR Documentation

Function to check wheather file is YAML format

Description

Function to check wheather file is YAML format

Usage

is.yaml.file(
  file = Sys.getenv("R_CONFIGFILE_ACTIVE", "config.cfg"),
  yaml.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)

yaml.file.debug

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

...

Arguments for is.json.file, readLines and yaml.load

Value

Logical indicating whether the specified configuration file is YAML format

See Also

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

Miachol/configr documentation built on July 22, 2023, 9:55 a.m.