isin: Test Whether One Vector Is In Another Vector
Description
See the title.
Usage
isin(x, ...)
## S3 method for class 'default':
isin(x, y, ordered = FALSE, \ldots)
## S3 method for class 'data.frame':
isin(x, \ldots)
Arguments
x, y
vectors.
ordered
logical.
...
further arguments to be passed to or from other methods.
Value
Logical, or a vector of logicals.
Details
The function will only return TRUE if every element of y is present in the vector x, counting multiplicity. See the examples below. Of ordered = TRUE, then elements must be in the vector x in the order specified in y. Compare this to the behavior of the %in% function in the base package.
This is a generic function with a moethod for data frames, which applies isin() to each row of the data frame, with a vector as a result.