plot_vocabulary() visualizes the vocabulary growth as new words are used in each document.
Usage
plot_vocabulary(
data,
x = progress,
by = doc_id,
identity = NULL,
descriptive_labels = FALSE,
labeling = c("point", "inset", "inline")
)Arguments
- data
A tidy data frame, potentially containing columns called "doc_id" and "word"
- x
A column showing the cumulative progress of documents
- by
A grouping column for colors and labels
- identity
A grouping column for lines
- descriptive_labels
A toggle for using descriptive labels for progress on the X-axis
- labeling
Options for labeling groups:
"point"labels the final value"inline"prints the label within a smoothed curve"inset"prints a legend within the plot areaAnything else prints a legend to the right of the plot area.
Examples
if (FALSE) { # \dontrun{
dubliners <- get_gutenberg_corpus(2814) |>
load_texts() |>
identify_by(part) |>
standardize_titles()
dubliners_measured <- dubliners |>
add_vocabulary()
dubliners_measured |>
plot_vocabulary(progress_percent)
dubliners_measured |>
plot_vocabulary()
get_micusp_corpus(
discipline %in% c("Physics", "Economics")) |>
load_texts() |>
add_vocabulary() |>
plot_vocabulary(by = discipline)
} # }
