Learn R Programming

yamlme (version 0.1.1)

write_rmd: Writing R-Markdown Documents

Description

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.

Usage

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

Value

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

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.

Examples

Run this code
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
}

Run the code above in your browser using DataLab