txt_freq: Frequency statistics of elements in a vector

View source: R/utils.R

txt_freqR Documentation

Frequency statistics of elements in a vector

Description

Frequency statistics of elements in a vector

Usage

txt_freq(x, exclude = c(NA, NaN), order = TRUE)

Arguments

x

a vector

exclude

logical indicating to exclude values from the table. Defaults to NA and NaN.

order

logical indicating to order the resulting dataset in order of frequency. Defaults to TRUE.

Value

a data.frame with columns key, freq and freq_pct indicating the how many times each value in the vector x is occurring

Examples

x <- sample(LETTERS, 1000, replace = TRUE)
txt_freq(x)
x <- factor(x, levels = LETTERS)
txt_freq(x, order = FALSE)

udpipe documentation built on Jan. 6, 2023, 5:06 p.m.