In this post, we will learn how to use dplyr's n_distinct() function to count the number of unique or distinct values in one or more vectors or columns of a dataframe. dplyr's n_distinct() is very useful when you are working with a dataframe and need to know how many unique … [Read more...] about dplyr n_distinct(): count unique elements or rows