I have a dataset df and I would like to remove all rows for which variable y does not have the value a. Variable y also c
df
y
a
One workaround is to use %in%:
%in%
subset(df, !y %in% "a") dplyr::filter(df, !y %in% "a")