R/operators.R

Defines functions `%notin%`

#' Not In Operator
#'
#' Returns logical vector indicating if elements are **not** in a given set.
#'
#' @param x vector or NULL: the values to be matched.
#' @param table vector or NULL: the values to be matched against.
#' @return A logical vector of the same length as `x`.
#' @examples
#' c("a", "b") %notin% c("b", "c")
#' @export
`%notin%` <- function(x, table) {
  !(x %in% table)
}

Try the hellometry package in your browser

Any scripts or data that you put into this service are public.

hellometry documentation built on Nov. 11, 2026, 5:06 p.m.