exrcise: Read an Rmd file and write a version with code chunks...

Description Usage Arguments Value Examples

View source: R/exrcise.R

Description

Read an Rmd file and write a version with code chunks selectively replaced

Usage

1
exrcise(infile, outfile, replace_flags, replacement = "", comment = TRUE)

Arguments

infile

A file path or file handle of an .Rmd file from which code chunks will be removed

outfile

A file path or file handle to which to write the .Rmd file with replacements.

replace_flags

A character vector of code chunk options that if set to TRUE will have their code replaced.

replacement

A character vector that code chunks will be replaced with, one element per line.

comment

TRUE or FALSE; whether to include comments. Default is TRUE

Value

A character vector of the output lines, invisibly.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## Not run: 
exrcise(infile, outfile,
    replace_flags = "live",
    replacement = "")

exrcise(infile, outfile,
    replace_flags = "solution",
    replacement = "### Your Code Here",
    comment = FALSE)

## End(Not run)

AlexsLemonade/exrcise documentation built on Aug. 8, 2020, 11:45 a.m.