Learn R Programming

TreeTools (version 1.15.0)

MatchStrings: 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, ...)

Value

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

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.

See Also

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

Examples

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

Run the code above in your browser using DataLab