| as_yaml_auto | R Documentation |
yaml header for an Rmd fileConverts a named list into a yaml header for Rmd, handling output types and arguments
as defined in the rmarkdown package. This function simplifies the process of generating yaml headers.
as_yaml_auto(
input_list,
as_header = TRUE,
convert_logi = TRUE,
multi_output = FALSE,
silent = FALSE
)
input_list |
( |
as_header |
( |
convert_logi |
( |
multi_output |
( |
silent |
( |
This function processes a non-nested (flat) named list into a yaml header for an Rmd document.
It supports all standard Rmd yaml header fields, including author, date, title, subtitle,
abstract, keywords, subject, description, category, and lang.
Additionally, it handles output field types and arguments as defined in the rmarkdown package.
character with rmd_yaml_header class,
result of yaml::as.yaml, optionally wrapped with internal md_header().
Only non-nested lists are automatically parsed.
Nested lists require direct processing with yaml::as.yaml.
# nested so using yaml::as.yaml directly
as_yaml_auto(
list(author = "", output = list(pdf_document = list(toc = TRUE)))
)
# auto parsing for a flat list, like shiny input
input <- list(author = "", output = "pdf_document", toc = TRUE, keep_tex = TRUE)
as_yaml_auto(input)
as_yaml_auto(list(author = "", output = "pdf_document", toc = TRUE, keep_tex = "TRUE"))
as_yaml_auto(list(
author = "", output = "pdf_document", toc = TRUE, keep_tex = TRUE,
wrong = 2
))
as_yaml_auto(list(author = "", output = "pdf_document", toc = TRUE, keep_tex = 2),
silent = TRUE
)
input <- list(author = "", output = "pdf_document", toc = TRUE, keep_tex = "True")
as_yaml_auto(input)
as_yaml_auto(input, convert_logi = TRUE, silent = TRUE)
as_yaml_auto(input, silent = TRUE)
as_yaml_auto(input, convert_logi = FALSE, silent = TRUE)
as_yaml_auto(
list(
author = "", output = "pdf_document",
output = "html_document", toc = TRUE, keep_tex = TRUE
),
multi_output = TRUE
)
as_yaml_auto(
list(
author = "", output = "pdf_document",
output = "html_document", toc = "True", keep_tex = TRUE
),
multi_output = TRUE
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.