rmd_to_r: Convert .Rmd to .R

Description Usage Arguments Value Note Author(s) Examples

Description

This function converts a .Rmd to a .R file (similar to knitr::purl) by replacing chunk delimiters and putting eval chunk options inside if statements. Also comments out (##+) content that is not inside chunks.

Usage

1
rmd_to_r(rmd, encoding = "UTF-8", write = TRUE)

Arguments

rmd

Path to a rmarkdown file.

encoding

The encoding of both the input .Rmd file and the output.

Value

A .R file in the same directory and same name as the input .Rmd file.

Note

UTF-8 is the recommended encoding for scripts and .Rmd files.

Author(s)

Kristian D. Olsen

Examples

1
rmd_to_r("Example report.Rmd", encoding = "latin1")

itsdalmo/reporttool documentation built on May 18, 2019, 7:11 a.m.