| 1 |
% Generated by roxygen2: do not edit by hand |
| 2 |
% Please edit documentation in R/yaml.R |
| 3 |
\name{yaml_load} |
| 4 |
\alias{yaml_load} |
| 5 |
\title{Read YAML data} |
| 6 |
\usage{ |
| 7 |
yaml_load( |
| 8 |
x, |
| 9 |
..., |
| 10 |
handlers = NULL, |
| 11 |
envir = parent.frame(), |
| 12 |
use_yaml = loadable("yaml") |
| 13 |
) |
| 14 |
} |
| 15 |
\arguments{ |
| 16 |
\item{x}{A character vector of YAML data.} |
| 17 |
|
| 18 |
\item{..., handlers}{Arguments to be passed to \code{\link[yaml:yaml.load]{yaml::yaml.load()}}.} |
| 19 |
|
| 20 |
\item{envir}{The environment in which R expressions in YAML are evaluated. To |
| 21 |
disable the evaluation, use \code{envir = FALSE}.} |
| 22 |
|
| 23 |
\item{use_yaml}{Whether to use the \pkg{yaml} package.} |
| 24 |
} |
| 25 |
\value{ |
| 26 |
An R object (typically a list). |
| 27 |
} |
| 28 |
\description{ |
| 29 |
If the \pkg{yaml} package is installed, use \code{\link[yaml:yaml.load]{yaml::yaml.load()}} to read the |
| 30 |
data. If not, use the simple parser \code{\link[=taml_load]{taml_load()}} instead. |
| 31 |
} |
| 32 |
\note{ |
| 33 |
R expressions in YAML will be returned as \link{expression}s when they are |
| 34 |
not evaluated. This is different with \code{\link[yaml:yaml.load]{yaml::yaml.load()}}, which returns |
| 35 |
character strings for expressions. |
| 36 |
} |
| 37 |
\examples{ |
| 38 |
yaml_load("a: 1") |
| 39 |
yaml_load("a: 1", use_yaml = FALSE) |
| 40 |
} |