Checks that all the elements in atomic vector x intersect with those in atomic vector y.
check_intersection(
x,
y,
all_y = FALSE,
x_name = substitute(x),
y_name = substitute(y),
error = TRUE
)
The object to check.
The second atomic vector.
A flag indicating whether all the elements in y should have a match in x.
A string of the name of the object x.
A string of the name of the object y.
A flag indicating whether to throw an informative error or immediately generate an informative message if the check fails.
An invisible copy of x (if it doesn't throw an error).
x1 <- 1:3
x2 <- 1:4
check_intersection(x1, x2)
#> Warning: `check_intersection()` was deprecated in checkr 0.5.1.
#> Please use `chk::chk_join()` instead.
check_intersection(x2, x1, error = FALSE)
#> Warning: `check_intersection()` was deprecated in checkr 0.5.1.
#> Please use `chk::chk_join()` instead.
#> Warning: x1 must include all the elements in x2