Description Usage Arguments Details Value Factors TODO
The positions of x
in from
are used to retrieve values from to
.
1 |
query |
The source vector of values. |
from |
The 'key' vector against which |
to |
The 'return' vector from which values are returned based on position. |
nomatch |
The returned value for cases where |
.warn_nomatch |
Warn in cases of no match? (Without a warning, one cannot distinguish the unmatched case vs the case where |
Given an entry in query
find the matching index in from
.
Then retrieve the value at that index in to
.
If an entry in query
cannot be found in from
, the corresponding returned value is nomatch
.
Take note that if to
contains any nomatch
values, presence of nomatch
in the returnd value doesn't indicate that some query
was missing in from
, but one can use the .warn_nomatch
case to disambiguate between these two cases.
Values in to
corresponding to the indices returned by match(query,from)
, or nomatch
.
What if query
is a factor?
To achieve factor recoding, use forcats::fct_recode
instead.
Consider adding an attribute to the return value with any unmapped indices?
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.