I need to remove rows in my data which satisfy more than one condition
the variables are
comorbidity
date_of_comorbidity
date_of_birth
i want to remove the rows where both comorbidity is equal to 10 AND date of comorbidity is less than date of birth
I have tried
newdata<-subset(df, !(comorbidity1==10 & date_of_comorbidity<date_of_birth))
This seems to remove the observations when it is one or the other
I need it to be only when both of these criteria occur in the same row.