powered by
Number of unique elements in a vector
NrUnique(x, na.rm = TRUE)
vector with the number of unique elements
object of type vector.
vector
logical indicating if missing values have to be removed. Default to TRUE.
TRUE
set.seed(1) x = sample(letters, 50, TRUE) NrUnique(x)
Run the code above in your browser using DataLab