Skip to contents

Read the YAML config file into a named list

Usage

read_user_cfg(cfg_dir = NULL, cfg_name = NULL)

Arguments

cfg_dir

A character string specifying the config directory, or NULL for the default. Default: An OS-specific path for user configuration files in the user's home directory.

cfg_name

A character string specifying the config file name, or NULL for the default. Default: 'config.yml'

Value

A named list of lists which corresponds to the loaded YAML config. See Details section for more info.

Details

String values are parsed to create appropriate types, for example, 'NA' would be converted into NA, 'true' into TRUE, '10' into 10L, etc.

Examples

read_user_cfg()
#> Warning: cannot open file '/home/runner/.config/R-dimex/config.yml': No such file or directory
#> Error in file(file, "rt", encoding = fileEncoding): cannot open the connection
if (FALSE) { # \dontrun{
read_user_cfg(file.path("path", "to", "config"), "conf.yml")
} # }