str_detect_any: Is (any element) of pattern in any of the elements of vec?

str_detect_anyR Documentation

Is (any element) of pattern in any of the elements of vec?

Description

I usually use it with a pattern of length 1.

Usage

str_detect_any(vec, pattern)

Arguments

vec

named vector

pattern

regex as in str_subset

Logical

Examples

str_detect_any(letters[1:3], c("c"))
str_detect_any(letters[1:3], c("d"))
str_detect_any(letters[1:3], c("c","d"))

dlill/conveniencefunctions documentation built on Sept. 30, 2022, 4:40 a.m.