grapes-qsin-grapes: Quick Search

%qsin%R Documentation

Quick Search

Description

This function performs a quick, case insensitive search of strings

Usage

string %qsin% vector

Arguments

string

character vector that contains the values to match

vector

character vector that has the values to be matched against

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

Author(s)

Dylan Russell (stackoverflow code, examples, and function details, function description), Irucka Embry

Source

data.table - R case-insensitive %in% - Stack Overflow answered and edited by Dylan Russell on Sep 13, 2020. See https://stackoverflow.com/questions/63874824/r-case-insensitive-in.

Examples


# Examples

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

"apple" %qsin% x

c("APPLE", "BANANA", "coconut", NA) %qsin% x





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