strintrplt: Performs string interpolation with arbitrary R code.
Description
This function allows a character vector to have arbitrary Rcode embedded within it. The embedded Rcode --- placed between ${ and } --- is evaluated by default in the environment from which this function is called (not defined). Any number of instances of embedded Rcode is possible. The result of the function is a character vector in which the embedded Rcode is replaced by character representations of the results of evaluating the embedded Rcode.
Usage
strintrplt(snippet,envir=parent.frame())
Arguments
snippet
A character vector of length one which may contain multiple ${RCODE} substrings which will be replaced by a character representation of the result of evaluating RCODE. This character vector may contain many Rstatements a
envir
The environment in which to evaluate the embedded Rcode.