replace_fmt {exams.forge}R Documentation

Replace

Description

In a text it replaces names with:

Usage

replace_fmt(txt, digits = 2L, ...)

Arguments

txt

character: text where the replacement is done

digits

numeric or list: number of digits to round

...

names to replace with values

Value

A character with replaced names.

Examples

replace_fmt("\\frac{x}{y}", x=2, y=3)
replace_fmt("\\frac{x}{y}", x=2, y=3, digits=0)
replace_fmt("\\frac{x}{y}", x=2, y=3, digits=list(0))
replace_fmt("\\frac{x}{y}", x=2, y=3, digits=list(2, y=0))
replace_fmt("\\frac{x}{y}", x="\\\\sum_{i=1}^n x_i", y="\\\\sum_{i=1}^n y_i")

[Package exams.forge version 1.0.10 Index]