How to subset a data frame based on "OR" condition in two columns? How can I use tidyverse?
I can do this by left join. Just wondering if there is any elegant way to do this better, since I have more than 2000 raws.
How to subset a data frame based on "OR" condition in two columns? How can I use tidyverse?
I can do this by left join. Just wondering if there is any elegant way to do this better, since I have more than 2000 raws.
We can use subset
from base R
subset(df1, ID %in% c('a', 'b') & Rep %in% 1:2)