tidy_frequencies: Returns tibble with frequencies of cat (lemma or word for...

View source: R/tidy_frequencies.R

tidy_frequenciesR Documentation

Returns tibble with frequencies of cat (lemma or word for instance) in data

Description

Returns tibble with frequencies of cat (lemma or word for instance) in data

Usage

tidy_frequencies(mydf, cat, top_freq = NA, min_freq = NA)

Arguments

mydf

a tibble

cat

words or lemmas, for instance

top_freq

how many items by category (filter based on frequency) should be kept. If not provided (the default) everything is kept.

min_freq

which is the minimum specificity for an item to be kept. If not provided (the default) everything is kept.

Value

a tibble of cat frequencies

Examples

mydf <- tibble::tibble(txt=janeaustenr::prideprejudice) %>%
  tidytext::unnest_tokens(word,txt)
tidy_frequencies(mydf, word, min_freq=200)

lvaudor/mixr documentation built on April 14, 2024, 2:17 p.m.