powered by
Unique values of a factor
fct_unique(f)
A factor.
f <- factor(letters[rpois(100, 10)]) unique(f) # in order of appearance fct_unique(f) # in order of levels
Run the code above in your browser using DataLab