write_rmd {yamlme}R Documentation

Writing R-Markdown Documents

Description

This function generates 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(object, ...)

## S3 method for class 'rmd_doc'
write_rmd(object, filename, ...)

Arguments

object

rmd_doc object used to write an Rmarkdown file. If header is missing, write_rmd() will fail with an error message.

...

Further arguments passed among methods (not yet used).

filename

A character value with the name of the file to be written. If not included, the extension *.Rmd will be appended to this name. 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

## Not run: 
my_document <- list(
  title = "Sample Document",
  author = "Miguel Alavarez",
  output = "html_document",
  body = txt_body(
    "# Intro",
    "",
    "This is just an example."
  )
)
my_document <- as(my_document, "rmd_doc")
write_rmd(my_document, filename = file.path(tempdir(), "example"))

## End(Not run)


[Package yamlme version 0.1.2 Index]