replace_block: Conditionally replace code in a block of lines

Description Usage Arguments Value

View source: R/replace_code_chunks.R

Description

Conditionally replace code in a block of lines

Usage

1
replace_block(block, replace_flags, replacement, comment)

Arguments

block

A character vector of lines from an Rmarkdown document that are either a section of text or a code chunk.

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.

Value

The input code chunk or text, modified only if it is a code chunk with one of the replace_flags in its options


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