str_match_replace: Match string and replace with corresponding value
Description
Partially match a string and replace with corresponding value. This function is useful to recover
the original names of variables after legalized using make.names or modified by other functions.
Usage
str_match_replace(x, to_match, to_replace)
Value
A vector.
Arguments
x
A vector.
to_match
A vector of strings to be matched.
to_replace
A vector of strings to replace the matched ones, must have the same length as to_match.