Checks that entries in one character vector occur in another, suggesting corrections for mismatched elements.
Arguments
- x, table
Character vectors, in which all elements of
x
are expected to occur intable
.- Fail
Function to call if a mismatch is found.
- max.distance, ...
Arguments to
agrep()
, used to propose possible matches to the user.
See also
Other string parsing functions:
EndSentence()
,
MorphoBankDecode()
,
RightmostCharacter()
,
Unquote()
Examples
tree <- BalancedTree(8)
MatchStrings(c("t1", "tip2", "t3"), TipLabels(tree), Fail = message)
#> Could not find 'tip2' in TipLabels(tree). Did you mean 't2'?
#> [1] "t1" "t3"