create_yaml_header {heddlr} | R Documentation |
Convert list objects into R Markdown YAML headers
Description
This function tweaks the behavior of as.yaml
to return
a string which can immediately be used as an R Markdown YAML header.
It's designed to accept both deeply nested lists and simpler list formats
to make reasoning about your header easier.
Usage
create_yaml_header(
...,
line.sep = c("\n", "\r\n", "\r"),
indent = 2,
unicode = TRUE,
indent.mapping.sequence = FALSE,
handlers = NULL
)
Arguments
... |
A set of objects that will be combined into the YAML header. Objects may be provided as lists (the structure list("outputs" = "html_document") translates to outputs: html_document) or as single-item named vectors (passing "title" = "My Report" to ... will translate to title: "My Report"). |
line.sep , indent , unicode , indent.mapping.sequence , handlers |
Additional arguments to be passed to |
Value
Returns a string formatted for use as an R Markdown YAML header.
See Also
Other manipulation functions:
heddle()
,
make_template()
,
provide_parameters()
,
use_parameters()
Examples
headerContent <- list(
"title" = "Testing YAML",
"author" = "Mike Mahoney",
"output" = list(
"flexdashboard::flex_dashboard" = list(
"vertical_layout" = "fill",
"orientation" = "rows",
"css" = "bootstrap.css"
)
)
)
create_yaml_header(headerContent)
create_yaml_header(
"title" = "testing",
"params" = list("data" = "NA"),
list("author" = "Mike Mahoney")
)
[Package heddlr version 0.6.0 Index]