This function generates YAML headers and R-Markdown documents by including the settings as arguments of the function. Comments and pieces of header can be also added through the argument append.

write_rmd(..., append, body = "", filename)

Arguments

...

Named arguments to be inserted in the YAML header. These arguments may be inserted either as vectors or lists.

append

A piece of code to be appended in the header. For instance, it can contain commented code.

body

The content of the document that will be inserted after the header.

filename

A character value with the name of the file to be written (usually a *.Rmd file). If missing, no file will be written by this function.

Value

A character vector of class rmd_doc and, if argument set for parameter filename, an Rmd file.

Examples

if (FALSE) { my_document <- write_rmd( title = "Sample Document", author = "Miguel Alavarez", output = "html_document", body = txt_body( "# Intro", "", "This is just an example.")) my_document }