How can I filter a vector based on regex list in R?
22:01 21 Aug 2022

I have a character string vector that I would like to filter based on keywords from a second vector.

Below is a small reprex:

list1 <- c("I like apples", "I eat bread", "Bananas are my favorite")
fruit <- c("apple","banana")

I am presuming I will be needing to use stringr/stringi, but I would, in essence, like to do something alongs the lines of list1 %in% fruit and it return T,F,T.

Any suggestions?

r stringr