txt_freq | R Documentation |
Frequency statistics of elements in a vector
txt_freq(x, exclude = c(NA, NaN), order = TRUE)
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. |
a data.frame with columns key, freq and freq_pct indicating the how
many times each value in the vector x
is occurring
x <- sample(LETTERS, 1000, replace = TRUE) txt_freq(x) x <- factor(x, levels = LETTERS) txt_freq(x, order = FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.