R/nin.R

#' @title Negated in-operator
#'
#' @description
#' This operator is equivalent to `!(x %in% y)`.
#'
#' @param x (`vector()`)\cr
#'   Values that should not be in `y`.
#' @param y (`vector()`)\cr
#'   Values to match against.
#' @usage x \%nin\% y
#' @rdname nin
#' @export
"%nin%" = function(x, y) {
  !match(x, y, nomatch = 0L)
}

Try the mlr3misc package in your browser

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

mlr3misc documentation built on Sept. 20, 2023, 5:06 p.m.