Sample Data
data =data.frame(id=c(1,1,1,2,2,2,3,3,3,4,4,4),
score=c(5,7,6,9,8,4,NA,11,3,7,NA,10))
So in this example if id has any scores equal to 7 than I want to remove those ids to get a new data frame such as:
data2 =data.frame(id=c(2,2,2,3,3,3),
score=c(9,8,4,NA,11,3))
I tried data[data$score != 7,]
but this only works for a row and not the group.