I have a dataframe df
like so
food color popular
apple red no
pear green no
banana yellow yes
apple red yes
How do i get nonduplicate rows based on only two columns (food & color)?
Expected result:
food color popular
pear green no
banana yellow yes
I tried:
df %>% distinct(food, color, .keep_all = TRUE)
but this doesn't give me my expected result