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.
yml_code(x) yml_params_code(x)
x | valid R code |
---|
a character vector with class verbatim
#> --- #> date: '`r sys.Date() `' #> --- #>#> --- #> params: #> date: !r sys.Date() #> --- #>