grapes-notchin-grapes: Not CHIN or IN for Character and Numeric Vectors

%notchin%R Documentation

Not CHIN or IN for Character and Numeric Vectors

Description

This function performs a quick, case sensitive search of character vectors that are not in a set of character vectors or a quick, search of numeric vectors that are not in a set of numeric vectors using Negate chin for character vectors and Negate in for numeric vectors

Usage

x %notchin% y

Arguments

x

character or numeric vector that contains the values to not be matched

y

character or numeric vector that has the values to be checked within

Details

'Utilizes chin from data.table to quickly complete a case insensitive search through a character vector to return a logical vector of string detections. Will always return TRUE or FALSE for each position of string regardless of NA missing values in either provided vector. NA in string will never match an NA value in the vector.'

Value

logical vector the length of the original string (x). TRUE means that x is not in y and FALSE means that x is in y

Author(s)

kaijagahm (R code), Irucka Embry

Source

The

Examples


# Examples

x <- c("apple", "banana", "cherry", NA)

"apple" %notchin% x

c("apple", "BANANA", "coconut", NA) %notchin% x

x


"a" %notchin% letters[5:20]
letters[5:20] %notchin% "a"


"a" %notchin% LETTERS
LETTERS %notchin% "a"


1 %notchin% -12:20
-12:20 %notchin% 1





iemisc documentation built on Sept. 25, 2023, 5:09 p.m.