fct_count {forcats} | R Documentation |
Count entries in a factor
Description
Count entries in a factor
Usage
fct_count(f, sort = FALSE, prop = FALSE)
Arguments
f |
A factor (or character vector). |
sort |
If |
prop |
If |
Value
A tibble with columns f
, n
and p
, if prop is TRUE
.
Examples
f <- factor(sample(letters)[rpois(1000, 10)])
table(f)
fct_count(f)
fct_count(f, sort = TRUE)
fct_count(f, sort = TRUE, prop = TRUE)
[Package forcats version 1.0.0 Index]