fct_count: Count entries in a factor

Description Usage Arguments Value Examples

View source: R/count.R

Description

Count entries in a factor

Usage

1

Arguments

f

A factor (or character vector).

sort

If TRUE, sort the result so that the most common values float to the top.

Value

A tibble with columns f and n.

Examples

1
2
3
4
f <- factor(sample(letters)[rpois(1000, 10)])
table(f)
fct_count(f)
fct_count(f, sort = TRUE)

tidyverse/forcats documentation built on Jan. 11, 2019, 11:10 a.m.