pmatchIC {Ecfun} | R Documentation |
pmatch ignoring case
Description
pmatch
with an additional
ignoreCase
argument, returning
a name not an index like
pmatch
(and returning
a name if supplied a number, unlike
pmatch
, which coerces
the input to numeric).
Usage
pmatchIC(x, table, nomatch = NA_integer_,
duplicates.ok = FALSE,
ignoreCase=TRUE)
Arguments
x |
the values to be matched.
If This is different from
Otherwise, if |
table |
the values to be matched against:
converted to a character vector,
per |
nomatch |
the value to be returned at non-matching or multiply partially matching positions. |
duplicates.ok |
should elements be in table be used
more than once? (See |
ignoreCase |
logical: if |
Value
A character vector of matches.
Author(s)
Spencer Graves
See Also
Examples
yr <- pmatchIC('Yr', c('y1', 'yr', 'y2'))
all.equal('yr', yr)
# integer
m2 <- pmatchIC(2, table=letters)
all.equal(m2, 'b')