powered by
This function counts how many times each element of vector x matches any element in vector y.
x
y
n_match(x, y)
An integer vector of the same length as x, where each element indicates the number of times it matches in y.
A vector of elements to be matched.
A vector in which the elements from x will be matched.
if (FALSE) { x <- c(1, 2, 3) y <- c(1, 1, 2, 4) n_match(x, y)}
Run the code above in your browser using DataLab