I have a vector:
v <- c("apple","banana","orange")
I want to search a column in my dataset and return either TRUE or FALSE if any of the elements of v are present.
As an example:
mystring <- "I have a grape but I have nothing else except an apple"
The solution I came up with is to use str_count to count the number of times my vector elements appear in mystring and then mutate based on the counts to get my boolean values -- ie, using case_when count > 0 and count == 0).
This seems like a poor approach. I'd really appreciate some guidance on a better way to do this.