Description Usage Arguments Details Value Author(s)
Creates mapper function
1 |
lst |
A list of string to pattern associations |
re |
whether to treat the patterns as regular expressions |
unmatched |
what to return if there is no mapping (default NULL returns the original value) |
This function creates and returns a function which renames
arguments or returns them unchanged if no mapping is provided.
The function is initialised using a list describing the reverse mapping. For example,
given list(a=c(1,2), b=3)
a function is returned that turns 1 and 2 in 'a',
3 into 'b' and leaves all other arguments unchanged.
When re
is TRUE,
name values are treated as regular expressions. In the returned
function the base R function grepl
is used to find the first
matching argument. It has its default parameters: no PERL-style regexps,
case sensitivity, and character rather than byte-based matching.
When re
is FALSE only exact matches trigger the mapping.
A mapper function
Will Lowe
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.