Learn R Programming

xfun (version 0.50)

yaml_load: Read YAML data

Description

If the yaml package is installed, use yaml::yaml.load() to read the data. If not, use the simple parser taml_load() instead.

Usage

yaml_load(
  x,
  ...,
  handlers = NULL,
  envir = parent.frame(),
  use_yaml = loadable("yaml")
)

Value

An R object (typically a list).

Arguments

x

A character vector of YAML data.

..., handlers

Arguments to be passed to yaml::yaml.load().

envir

The environment in which R expressions in YAML are evaluated. To disable the evaluation, use envir = FALSE.

use_yaml

Whether to use the yaml package.

Examples

Run this code
yaml_load("a: 1")
yaml_load("a: 1", use_yaml = FALSE)

Run the code above in your browser using DataLab