Skip to contents

Read YAML from a file or text string

Usage

read_yaml(
  x,
  encoding = clairvoyant::opts$get("encoding"),
  rlWarn = clairvoyant::opts$get("rlWarn"),
  silent = clairvoyant::opts$get("silent")
)

Arguments

x

The path to the file or the text contents

encoding

The encoding opf the file

rlWarn

Whether to let readLines() warn if a text file is missing a final EOL or if there are embedded NULs in the file.

Value

The R object with the data in the YAML file (see yaml::read_yaml()

Examples

examplePath <-
  system.file(
    "extdata",
    package="clairvoyant"
  );

exampleFile <-
  file.path(
     examplePath,
     "assertion---somePrevalenceEstimate_2024_mr4n.yml"
  );

exampleObject <-
  clairvoyant::read_yaml(
    exampleFile
  );