Efficiently count the number of unique values in a vector.
This is a faster and more concise equivalent of
- a vector of values
x <- sample(1:10, 1e5, rep = TRUE) length(unique(x)) n_distinct(x)
Looks like there are no examples yet.