Description Usage Arguments See Also Examples
View source: R/use_parameters.R
R Markdown documents allow you to pass almost any object – including large data frames and functions – to the document as parameters, letting you only define them once to use them in both your document generator and the generated document. This function makes it slightly easier to do so, by adding your objects to the YAML header and then initializing them so you can use the same object names in your generated document as in your generator.
1 | use_parameters(template, ..., init.params = TRUE, is.file = FALSE)
|
template |
An atomic ( |
... |
Objects to be included as parameters. Objects should be unquoted and exist in the current session environment. This function currently will always assign parameters NA as a default value, and does not yet provide an option to override that. |
init.params |
A boolean ( |
is.file |
A boolean value indicating if the template argument is a
vector containing the template ( |
Other manipulation functions:
create_yaml_header()
,
heddle()
,
make_template()
,
provide_parameters()
1 2 | template <- make_template("---\ntitle: Cool Report\noutput: html_document\n---\n")
use_parameters(template, data)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.