grapes-qsin-grapes: Quick Search

%qsin%R Documentation

Quick Search

Description

Quick case-insensitive search of strings in a character vector

Usage

str %qsin% vec

Arguments

str

a character vector: the values to be matched

vec

a character vector: the values to be matched against

Details

Utilizes data.table::%chin% to rapidly 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 str regardless of NA missing values in either provided vector. NA in str will never match an NA value in vec.

Value

a logical vector of length length(str)

Examples

x <- c("apple","banana","cherry",NA)
nsqipr:::`%qsin%`("apple",x) # could also use "apple" %qsin% x
nsqipr:::`%qsin%`(c("APPLE","BANANA","coconut", NA), x)


dylanrussellmd/nsqipr documentation built on Oct. 13, 2023, 11:01 a.m.