powered by
fct_unique(f)
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