use_parameters: Automatically include session objects as report parameters
Description
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.
An atomic (length(template) == 1) character vector
containing either the template to manipulate OR the path to the file storing
the template, which will be imported via import_pattern.
...
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 (TRUE/FALSE) value indicating if
a chunk initalizing the parameters (that is, assigning them via
object <- params$object) should be included. Default TRUE.
is.file
A boolean value indicating if the template argument is a
vector containing the template (FALSE, default) or the path to the
template file (TRUE).