I have an issue about removing the groups that contain certain strings in its rows for example if includes .. I would like to achive this without breaking the p
.
Here is one option in base R with subset and table
base R
subset
table
subset(df, gr %in% names(which(!table(gr, grepl("\\.", vals))[,2]))) # vals gr #1 good 1 #2 bad 1 #3 ugly 1