powered by
This function checks whether a specific element from vector x appears exactly once in vector y.
x
y
matches_once(x, y)
A logical vector of the same length as x, where each element is TRUE if it matches exactly once in y, and FALSE otherwise.
TRUE
FALSE
A vector containing the elements to match.
A vector in which the elements from x will be matched.
if (FALSE) { x <- c(1, 2, 3) y <- c(1, 1, 2, 4) matches_once(x, y)}
Run the code above in your browser using DataLab