Learn R Programming

parsermd (version 0.1.3)

chunk_options: Get and set code chunk options

Description

Helper functions for obtaining or changing chunk options within an rmd object.

Usage

rmd_set_options(x, ...)

rmd_get_options(x, ..., defaults = list())

Value

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.

Arguments

x

An rmd_ast, rmd_tibble, or any rmd ast node object.

...

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.

Examples

Run this code
rmd = parse_rmd(system.file("minimal.Rmd", package = "parsermd"))

str(rmd_get_options(rmd))
str(rmd_get_options(rmd), "include")

rmd_set_options(rmd, include = TRUE)

Run the code above in your browser using DataLab