Utilities for strings and function arguments.
Description
gsubfn is like gsub but can take a replacement function
or proto object rather than a replacement string. Matches and
back references are input to the function and replaced by the
function output. In the case of a proto object the object is
used for sharing information from one match to the next.
gsubfn can be used to split strings based on content rather than
delimiters and for quasi-perl-style string interpolation. The
package also has facilities for translating formulas to functions
and allowing such formulas in function calls instead of functions.
This can reduce code size and improve clarity when using apply,
lapply, optim, integrate, xyplot and any other function that
expects another function as an input argument.