MatchStrings: Check for mismatch between character vectors

View source: R/MatchStrings.R

MatchStringsR Documentation

Check for mismatch between character vectors

Description

Checks that entries in one character vector occur in another, suggesting corrections for mismatched elements.

Usage

MatchStrings(x, table, Fail = stop, max.distance = 0.5, ...)

Arguments

x, table

Character vectors, in which all elements of x are expected to occur in table.

Fail

Function to call if a mismatch is found.

max.distance, ...

Arguments to agrep(), used to propose possible matches to the user.

Value

MatchStrings() returns the elements of x that occur in table.

Author(s)

Martin R. Smith (martin.smith@durham.ac.uk)

See Also

Other string parsing functions: EndSentence(), MorphoBankDecode(), RightmostCharacter(), Unquote()

Examples

tree <- BalancedTree(8)
MatchStrings(c("t1", "tip2", "t3"), TipLabels(tree), Fail = message)

TreeTools documentation built on Aug. 8, 2025, 7:18 p.m.