knitif {exams.forge}R Documentation

Knitting a Text Argument

Description

Selects a text argument and returns the knitted result.

Usage

knitif(n, ..., envir = knit_global())

knit_select(n, ..., envir = knit_global())

Arguments

n

character: text argument to use

...

character: arguments to choose from

envir

environment: in which code chunks are to be evaluated (default: ⁠[knitr::knit_global]⁠)

Value

A character.

Examples

knitif(runif(1)<0.5, 'TRUE'="`r pi`", 'FALSE'="$\\pi=`r pi`$")

[Package exams.forge version 1.0.10 Index]