R/not_in.R

#' "Not in" function
#'
#' The opposite of `%in%`.  Returns `TRUE` if `x` is not `%in%` `y`.  Returns
#' `FALSE` otherwise.
#'
#' @param x a value
#' @param y a list of values
#' @return a `TRUE` or `FALSE`
#'
#' @examples
#' "a" %!in% c("a", "b", "c")
#' "a" %notin% c("b", "c")
#'
#' @export


'%notin%' <- function(x, y) {
  !('%in%'(x, y))
}

#' @rdname grapes-notin-grapes
#' @export
`%!in%` <- `%notin%`

Try the SwimmeR package in your browser

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

SwimmeR documentation built on March 31, 2023, 8:27 p.m.