match{base}
returns a vector of the positions of (first) matches of its first argument in its second.
%in%
is a more intuitive interface as a binary operator, which returns a logical vector indicating if there is a match or not for its left operand.
match(x,table,nomatch=NA_integer_,incomparables=NUL)
x %in% table
区别:
x %in% table:结果为与x等长的TURE/FALSE向量
match(x,table):结果为与x等长的向量
(1)x[i]在table中未出现,则为NA
(2)x[i]在table中的位序