excluding names that don't match criteria

Hello there,

I'm new to the RStudio Community, and wanted to reach out for some help.

I have a dataset that contains a description (~ a paragraph or each within each cell) and a column for the name that corresponds to that description. I have a list of words that I'm looking for within each description, the problem is that I want to exclude terms that have not attached to them, i.e. "automated" vs "not automated."

So far, I've been using: data$DATASET.NAME[grep("automat",data$System)], which gives me the name of all that contain that term. But this is also giving me the names of ones that contain "not automat."

Does anyone have any tips or know which function(s) would be helpful? Any help would be great.


Hi! It’s a bit hard without seeing your data, but you should check out the
stringr package and this chapter in R for Data Science. Depending on your data and desired outcome I guess you could also use dplyr::filter(DF, colname == “automat”).