rres_knit_solutions: Render two versions of a file, with and without solutions

View source: R/knit_utils.R

rres_knit_solutionsR Documentation

Render two versions of a file, with and without solutions

Description

This function assumes the YAML header of an R Markdown file uses a parameter called solutions, params: solutions which has two values, TRUE and FALSE. The file may use this parameter to adjust the r markdown chunk options such as eval or echo when rendering to output the solutions to exercises or not.

Usage

rres_knit_solutions(input, ...)

Arguments

input

text: the name of the file to be rendered

...

text: other parameters to be passed to the render function

Details

The function may be placed in the YAML header of an R Markdown document where it will be invoked on the first output type.

See Rmarkdown Cookbook Section 17.5 as a reference https://bookdown.org/yihui/rmarkdown-cookbook/custom-knit.html

Value

creates two output files in the default directory. . One has no solutions in the output and the second has solutions and the word solutions in the output file name.

Examples

# Use the following YAML setting after removing the leading comment
# knit: rresutils::rres_knit_solutions


rressler/rresutils documentation built on Aug. 27, 2023, 12:37 p.m.