Skip to content

Commit

Permalink
notin docs #5481 (#5729)
Browse files Browse the repository at this point in the history
  • Loading branch information
jangorecki authored Dec 8, 2023
1 parent ae215c7 commit 4e7d46b
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions man/notin.Rd
Original file line number Diff line number Diff line change
@@ -1,33 +1,30 @@
\name{notin}
\alias{\%notin\%}

\title{
Convenience operator for checking if an example is not in a set of elements
}

\description{
Check whether an object is absent from a table, i.e., the logical inverse of \code{\link[=base]{in}}.
Check whether an object is absent from a table, i.e., the logical inverse of \code{\link[=base]{in}}. See examples on how missing values are being handled.
}

\usage{
x \%notin\% table
}

\arguments{
\item{x}{ Vector or \code{NULL}: the values to be matched. }
\item{table}{ Vector or \code{NULL}: the values to be matched against. }
}


\value{
Logical vector, \code{TRUE} for each element of \code{x} \emph{absent} from \code{table}, and \code{FALSE} for each element of \code{x} \emph{present} in \code{table}.
}

\seealso{ \code{\link[base]{match}}, \code{\link[data.table]{chmatch}} }


\examples{
11 \%notin\% 1:10 # TRUE
"a" \%notin\% c("a", "b") # FALSE
}

## NAs on the LHS
NA \%in\% 1:2
NA \%notin\% 1:2
## NAs on the RHS
NA \%in\% c(1:2,NA)
NA \%notin\% c(1:2,NA)
}

0 comments on commit 4e7d46b

Please sign in to comment.