I\'m trying to create a subset of a data frame of news articles that mention at least one element of a set of keywords or phrases.
# Sample data frame of ar
You can try pasting your "keywords" together and separate them with the pipe character (|) which will work like an "or", like this:
> articles[grepl(paste(keywords, collapse="|"), articles$text),]
id text
1 1 Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
2 2 tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
4 4 consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse