match() returns a vector of the positions of (first) matches of splits in
its first argument in its second.
%in% is a more intuitive interface as a binary operator, which returns
a logical vector indicating whether there is a match or not for each
split in its left operand.
Usage
# S4 method for class 'Splits,Splits'
match(x, table, nomatch = NA_integer_, incomparables = NULL)
match(x, table, nomatch = NA_integer_, incomparables = NULL)
# S4 method for class 'Splits,Splits'
x %in% tableValue
match() returns an integer vector specifying the position in
table that matches each element in x, or nomatch if no match is found.
See also
Corresponding base functions are documented in
match().
Other Splits operations:
LabelSplits(),
NSplits(),
NTip(),
PolarizeSplits(),
SplitFrequency(),
Splits,
SplitsInBinaryTree(),
TipLabels(),
TipsInSplits(),
xor()
Examples
splits1 <- as.Splits(BalancedTree(7))
splits2 <- as.Splits(PectinateTree(7))
match(splits1, splits2)
#> [1] 3 1 NA NA