Seeks a unique match of its first argument among the elements of its second. If successful, it returns this element; otherwise, it performs an action specified by the third argument.
a character string to be expanded.
a character vector with the values to be matched against.
an R expression to be evaluated in case expansion was not possible.
This function is particularly useful when abbreviations are allowed in function arguments, and need to be uniquely expanded with respect to a target table of possible values.
A length-one character vector, one of the elements of
nomatch is changed to be a non-error, when it can be a
zero-length character string).
pmatch for performing
partial string matching.
1 2 3