Count distinct values
Returns the number of distinct values in a vector or list. Inside
summarize(), this acts as an aggregation expression.
x (Vector | List): The input
values.
na_rm (Bool): = false Exclude NA
values from the count.
The number of distinct values.
summarize(df, $unique_species = n_distinct($species))