Here's my case. I have a df with text rows and a df with IDs. I want to know if the IDs appear in my text. Here's my code – do I overlook s.th.?
df <- data.frame(text=c("random text with ID _OMaUIC4Om",
"random text with ID _tqlb6VsVN",
"random text with ID 0AcMp9JJ8q",
"random text with ID _tqlb6VsVN",
"random text with ID _tqlb6VsVN",
"random text with ID"))
df.id <- data.frame(id=c("_4pGCmTAat","_tqlb6VsVN","_OMaUIC4Om","0AcMp9JJ8q"))
check <- subset(df, text %in% df.id$id)
check <- subset(df, grep(df.id$id, text))