R/ranges-eval.R
n_distinct.Rd
This is a wrapper to length(unique(x))
or
lengths(unique(x))
if x
is a List object
n_distinct(var)
a vector of values
an integer vector
x <- CharacterList(c("a", "b", "c", "a"), "d")
n_distinct(x)
#> [1] 3 1
n_distinct(unlist(x))
#> [1] 4