powered by
Count entries in a factor
fct_count(f, sort = FALSE)
A factor (or character vector).
If TRUE, sort the result so that the most common values float to the top.
TRUE
A tibble with columns f and n.
f
n
# NOT RUN { f <- factor(sample(letters)[rpois(1000, 10)]) table(f) fct_count(f) fct_count(f, sort = TRUE) # }
Run the code above in your browser using DataLab