R/not_in.R

#' Not in
#' Checks that value of x is not in the table vector.
#'
#' @param x vector or NULL: the values not to be matched. Long vectors are supported.
#' @param table vector or NULL: the values to be matched against. Long vectors are not supported.
#'
#' @return a logical vector
"%not_in%" <- function(x, table) {
  result <- match(x, table, nomatch = 0)
  ifelse(result == 0, TRUE, FALSE)
}
supertux83/rccs documentation built on Aug. 1, 2020, 11:53 p.m.