Skip to contents

This function reads a YAML file and returns it as an R list.

Usage

load_config(file_path)

Arguments

file_path

Path to the YAML configuration file.

Value

A list representing the parsed YAML configuration.

Examples

if (FALSE) { # \dontrun{
# Load the example configuration file included with the package
config_path <- system.file("extdata", "example_config.yaml", package = "Rydra")

# Fallback for development when package is not installed
if (config_path == "" && file.exists("inst/extdata/example_config.yaml")) {
  config_path <- "inst/extdata/example_config.yaml"
}

if (file.exists(config_path)) {
  my_config <- load_config(config_path)
  # You can now inspect parts of the configuration
  # print(my_config$plgf_model$reference_paper)
  # print(names(my_config))
} else {
  print("Could not find example_config.yaml for load_config example.")
}
} # }