plot_frequencies: Returns a plot showing frequencies of cat (lemma or word for...

View source: R/plot_frequencies.R

plot_frequenciesR Documentation

Returns a plot showing frequencies of cat (lemma or word for instance) in data

Description

Returns a plot showing frequencies of cat (lemma or word for instance) in data

Usage

plot_frequencies(
  df_freq,
  cat,
  frequency,
  scale = NA,
  fill = NULL,
  fill_fixed = "grey50"
)

Arguments

df_freq

a tibble with frequencies of cat

cat

words or lemmas, for instance

frequency

frequency of cat

scale

type of transformation (if any) to apply to the x-axis (e.g. "log","sqrt",etc.)

Value

a plot

Examples

mydf <- tibble::tibble(txt=janeaustenr::prideprejudice) %>%
    tidytext::unnest_tokens(word,txt)
df_freq <- tidy_frequencies(mydf, word, min_freq=500)
plot_frequencies(df_freq,
                 cat=word,
                 frequency=freq)

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