purl
function to include
the default parameter values in the R code it emits.knit_params(text)
knit_param
that correspond to the
parameters declared in the params
section of the YAML front matter.
These objects have the following fields:[object Object],[object Object],[object Object]
In addition, other fields included in the YAML may also be present
alongside the name, type, and value fields (e.g. a label
field
that provides front-ends with a human readable name for the parameter).
params
key.
This key can have any number of subkeys each of which represents a
parameter. For example:--- title: My Document output: html_document params: frequency: 10 show_details: true ---
Parameter values can be provided inline as illustrated above or can be
included in a value
sub-key. For example:
--- title: My Document output: html_document params: frequency: value: 10 ---
This second form is useful when you need to provide additional details
about the parameter (e.g. a label
field as describe above).
Parameter types are deduced implicitly based on the value provided. However in some cases additional type information is required (for example when a character vector needs to be interpreted as a date or as a file path). In these cases a special type designater precedes the value. For example:
--- title: My Document output: html_document params: start: !date 2015-01-01 ---