
Last chance! 50% off unlimited learning
Sale ends in
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.
# S4 method for Splits,Splits
match(x, table, nomatch = NA_integer_, incomparables = NULL)in.Splits(x, table)
match(x, table, nomatch = NA_integer_, incomparables = NULL)
# S4 method for Splits,Splits
%in%(x, table)
match()
returns an integer vector specifying the position in
table
that matches each element in x
, or nomatch
if no match is found.
Object of class Splits
.
Integer value that will be used in place of NA
in the case
where no match is found.
Ignored. (Included for consistency with generic.)
in.Splits()
is an alias for %in%
, included for backwards compatibility.
It is deprecated and will be removed in a future release.
splits1 <- as.Splits(BalancedTree(7))
splits2 <- as.Splits(PectinateTree(7))
match(splits1, splits2)
Run the code above in your browser using DataLab