Skip to contents

Get get_frequencies of values in a vector

Usage

get_frequency(x, percent = FALSE)

get_tf(x, percent = TRUE)

Arguments

x

A vector, such as a column of character strings

percent

Whether to return frequencies as percentage of the whole

Value

A vector of counts or ratios for each value of x.

See also

Examples

my_values <- c("dog", "cat", "dog")

get_frequency(my_values)
#> [1] 2 1 2