How can I filter a vector based on regex list in R?
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?