Subset data frame based on multiple conditions [duplicate]
I wish to filter a data frame based on conditions in several columns. For example, how can I delete rows if column A = B and Column E = 0.
Logic index:
d<-d[!(d$A=="B" & d$E==0),]
Subset is your safest and easiest answer.
subset(dataframe, A==B & E!=0)
Real data example with mtcars
subset(mtcars, cyl==6 & am!=0)