yml_code: Take code and write it as valid YAML

View source: R/yml_helpers.R

yml_codeR Documentation

Take code and write it as valid YAML

Description

yml_code() takes R code and writes it as valid YAML to be evaluated during knitting. Note that yml_code() does not evaluate or validate the R code but only captures it to use in the YAML field. R code needs to be formatted differently when using in the params field for parameterized reports; yml_params_code will format this correctly for you.

Usage

yml_code(x)

yml_params_code(x)

Arguments

x

valid R code

Value

a character vector with class verbatim

See Also

yml_verbatim()

Examples


yml_empty() %>%
  yml_date(yml_code(sys.Date()))

yml_empty() %>%
  yml_params(date = yml_params_code(sys.Date()))


ymlthis documentation built on Aug. 5, 2022, 5:23 p.m.