firstmatch seeks matches for the elements of its first argument among those of its second.
For further details please check base::charmatch(). charmatch returns a zero if multiple matches are found, whereas firstmatch
returns the first partial match if multiple matches are found.
Usage
firstmatch(x, table, nomatch = NA_integer_)
Value
An integer.
Arguments
x
character: the values to be matched; converted to a character vector if necessary
table
character: the values to be matched against; converted to a character vector if necessary
nomatch
integer: the value to be returned at non-matching positions (default: NA_integer_)