R/IN.R

#' Case insensitive version of %in%
#'
#' This is simply 'in', but applies [base::toupper()] to both
#' arguments, first.
#'
#' @param find The element(s) to look up in the vector or matrix.
#' @param table The vector or matrix in which to look up the element(s).
#'
#' @usage find \%IN\% table
#'
#' @return A logical vector.
#' @rdname IN
#' @aliases %IN%
#' @examples letters[1:4] %IN% LETTERS
#'
#' @export
"%IN%" <- function(find, table) {
  return(toupper(find) %in% toupper(table));
}

Try the ufs package in your browser

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

ufs documentation built on July 9, 2023, 6:07 p.m.