Learn R Programming

yamlme (version 0.1.1)

read_rmd: Read R-markdown Documents

Description

The function read_rmd() reads Rmd files into character vectors pasting a line break at the end of each line. The function txt_body() will do the same to one or more character vectors.

Usage

read_rmd(
  file,
  ...,
  append = "# document imported by 'read_rmd'",
  skip_head = TRUE
)

txt_body(...)

Value

An object of class rmd_doc by the function read_rmd(). The function txt_body() retrieves a character vector suitable for the parameter body

in the function write_rmd().

Arguments

file

Character value indicating the path and the name to the Rmd file.

...

Arguments passed by read_rmd() to readLines(). In txt_body() they are character values passed to c().

append

Character value passed to function read_rmd().

skip_head

Logical value indicating whether the yaml head should be skip or not (this argument is not used at the moment).

Examples

Run this code
if (FALSE) {
## Read pre-installed example
ex_document <- read_rmd(file.path(path.package("yamlme"),
    "taxlistjourney.Rmd"))

## Include this document as body
my_document <- write_rmd(
		title = "A journey in rOpenSci",
		author = "Miguel Alvarez",
		output = "html_document",
		body = ex_document)
}

Run the code above in your browser using DataLab