Using dplyr to summarise a dataset, I want to call n_distinct to count the number of unique occurrences in a column. However, I also want to do another summarise() for all uniqu
Filtering the dataframe before performing the summarise works
a %>% filter(B=="Y") %>% summarise(count = n_distinct(A))