Learn R Programming

udpipe (version 0.8.3)

txt_freq: 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

Run this code
# NOT RUN {
x <- sample(LETTERS, 1000, replace = TRUE)
txt_freq(x)
x <- factor(x, levels = LETTERS)
txt_freq(x, order = FALSE)
# }

Run the code above in your browser using DataLab