R/notIn.r

#' Opposite of '\%in\%'
#'
#' @description Indicate if elements of a vector are not in another vector.
#'
#' @param x,table Vectors.
#' @return A logical vector.
#'
#' @examples
#'
#' x <- c('a', 'v', 'o', 'C', 'a', 'd', 'O')
#' y <- letters
#'
#' y %notin% x
#' x %notin% y
#'
#' @export
notIn <- compiler::cmpfun( function(x, table) !(x %in% table) )


#' @name `%notin%`
#' @title Opposite of '%in%'
#' @rdname notIn
#' @export
`%notin%` <- notIn

Try the omnibus package in your browser

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

omnibus documentation built on Sept. 17, 2024, 5:09 p.m.