I have a dictionary with terms
terms <- c("hello world", "great job")
terms <- as.data.frame(terms)
, and i would like to search for the first match in additional data.frame which contains documents
doc <- c("i would like to say hello worlds", "hey friends hello world everyone", "i'm looking for a great job", "great job")
docs <- as.data.frame(doc)
desired outcome:
foundtext <- c("i would like to say hello worlds","i'm looking for a great job")
output <- cbind(terms, foundtext)
Thank you for your assistance!