Learn R Programming

yamlme (version 0.1.1)

render_rmd: Render documents from object

Description

This function is a wrapper of rmarkdown::render() and will also work with file names but also enables the possibility of rendering from objects created by write_rmd().

Usage

render_rmd(input, ...)

# S3 method for character render_rmd(input, ...)

# S3 method for rmd_doc render_rmd( input, output_file, temp_file = "_temp.Rmd", delete_temp = TRUE, ... )

Arguments

input

Either a character value indicating the path and the name of the r-markdown file, or an object of class rmd_doc, written by write_rmd().

...

Further parameters passed to rmarkdown::render().

output_file

A character value indicating the name of the output file. It is passed to rmarkdown::render().

temp_file

A name for a temporary file created to render the object.

delete_temp

A logical value indicating whether temp_file should be deleted after rendering or not.

Examples

Run this code
if (FALSE) {
## copy example to your working directory
filename <- "taxlistjourney.Rmd"
file.copy(from=file.path(path.package("yamlme"), filename), to=filename)

## Render the file with rmarkdown::render()
render_rmd(filename, output_file="example")

## Render the file with yamlme
text_document <- read_rmd(filename)

rmd_document <- write_rmd(title="my title", author="my name",
    output="html_document", body=text_document)

render_rmd(rmd_document, output_file="example2")
}

Run the code above in your browser using DataLab