%qsin% | R Documentation |
Quick case-insensitive search of strings in a character vector
str %qsin% vec
str |
a character vector: the values to be matched |
vec |
a character vector: the values to be matched against |
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
.
a logical vector of length length(str)
x <- c("apple","banana","cherry",NA)
nsqipr:::`%qsin%`("apple",x) # could also use "apple" %qsin% x
nsqipr:::`%qsin%`(c("APPLE","BANANA","coconut", NA), x)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.