template.replace replaces keys within special markups with
values in a so-called template file. Pieces of R code can be put into
the markups of the template file, and are evaluated during the
replacement.
boolean, TRUE if the code within
code.pattern has to be evaluated, FALSE otherwise.
key.pattern
custom pattern for key replacement (see below)
code.pattern
custom pattern for code replacement (see below)
Details
In most cases, a computational code reads its inputs from a text
file. A template file is like an input file, but where some missing
values, identified with generic keys, will be replaced by specific
values.
By default, the keys are enclosed into markups of the form $(KEY).
Code to be interpreted with R can be put in the template text. Pieces
of code must be enclosed into markups of the form
@{CODE}. This is useful for example for formating the key
values (see example). For interpreting the code, set eval = TRUE.
Users can define custom patterns. These patterns must be
perl-compatible regular expressions (see regexpr.
The default ones are: