I have a problem with deleting groups that contain certain lines in its lines, for example, if it includes .. I would like to achieve this without breaking the assembly line. I mean without using any function join.
Sample data
vals <- c("good","bad",'ugly',"good","bad.","ugly")
gr <- gl(2,3)
vals gr
1 good 1
2 bad 1
3 ugly 1
4 good 2
5 bad. 2
6 ugly 2
df <- data.frame(vals,gr)
I tried
library(dplyr)
df%>%
filter(!grepl("\\.",vals))
which deletes only the line matching the condition. But I want to remove the integers gr 2.
vals gr
1 good 1
2 bad 1
3 ugly 1
4 good 2
5 ugly 2
source
share