fct_describe: Decribe factor

View source: R/dt_describe.R

fct_describeR Documentation

Decribe factor

Description

Outputs a single character with names and counts of each level of the input factor

Usage

fct_describe(x, max_n = 5, return_ordered = TRUE)

Arguments

x

factor

max_n

Integer: Return counts for up to this many levels

return_ordered

Logical: If TRUE, return levels ordered by count, otherwise return in level order

Value

Character with level counts

Author(s)

E.D. Gennatas

Examples

## Not run: 
# Small number of levels
fct_describe(iris$Species)

# Large number of levels: show top n by count
x <- factor(sample(letters, 1000, TRUE))
fct_describe(x)
fct_describe(x, 3)

## End(Not run)


egenn/rtemis documentation built on Dec. 17, 2024, 6:16 p.m.