This function reads the YAML front-matter section of a document and returns a
list of any parameters declared there. This function exists primarily to
support the parameterized reports feature of the rmarkdown package,
however is also used by the knitr
purl function to include
the default parameter values in the R code it emits.
Character vector containing the document text.
Parameters are included in YAML front matter using the
This key can have any number of subkeys each of which represents a
parameter. For example:
1 2 3 4 5 6 7
Parameter values can be provided inline as illustrated above or can be
included in a
value sub-key. For example:
1 2 3 4 5 6 7
This second form is useful when you need to provide additional details
about the parameter (e.g. a
label field as describe above).
You can also use R code to yield the value of a parameter by prefacing the value
!r, for example:
1 2 3 4 5 6
List of objects of class
knit_param that correspond to the
parameters declared in the
params section of the YAML front matter.
These objects have the following fields:
The parameter name.
The default value for the parameter.
The R expression (if any) that yielded the default value.
In addition, other fields included in the YAML may also be present
alongside the name, type, and value fields (e.g. a
that provides front-ends with a human readable name for the parameter).
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.