rmd2r: Convert .Rmd file to a ready to run .R script

Description Usage Arguments Details Author(s)

View source: R/rmd2r.R

Description

Converts markdown text to comments (following roxygen protocol) and optionally comments out code chunks that produce plots.

Usage

1
rmd2r(x, file, noPlots = TRUE, rmTags = TRUE, stripMD = FALSE)

Arguments

x

the Rmd file

file

the file to write to, defaults to same name as x but appended with '.R'

noPlots

logical, should plotting chunks be commented out

rmTags

logical, should code chunk tags be removed

stripMD

logical, should markdown text be removed

Details

This function is inspired by code from Kevin Keena (http://rstudio-pubs-static.s3.amazonaws.com/12734_0a38887f19a34d92b7311a2c9cb15022.html). However, rmd2r is a complete re-write and adds the functionallity to specify a file in which to write the outpu and also the option to comment out plotting chunks (useful, e.g., if you'd like to run the script in the background)

Author(s)

Andy Rominger <ajrominger@gmail.com>


ajrominger/socorro documentation built on Jan. 3, 2020, 6:25 a.m.