chunk_options | R Documentation |
Helper functions for obtaining or changing chunk options within an rmd object.
rmd_set_options(x, ...)
rmd_get_options(x, ..., defaults = list(), yaml_style = TRUE)
x |
An |
... |
Either a collection of named values for the setter or a character values of the option names for the getter. |
defaults |
A named list of default values for the options. |
yaml_style |
logical, if |
rmd_set_options
returns the modified version of the original object.
rmd_get_options
returns a list of the requested options (or all options if none
are specified). Non-chunk nodes return NULL
.
rmd = parse_rmd(system.file("examples/minimal.Rmd", package = "parsermd"))
str(rmd_get_options(rmd))
str(rmd_get_options(rmd, "include"))
# Get options in YAML style (default) vs normalized style
chunk = rmd_chunk("r", "test", options = list(`fig-width` = 8, eval = TRUE))
rmd_get_options(chunk, yaml_style = TRUE) # fig-width
rmd_get_options(chunk, yaml_style = FALSE) # fig.width
rmd_set_options(rmd, include = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.