plot_hapax() visualizes a sampling of hapax legomena projected on faceted curves of vocabulary growth over time
Usage
plot_hapax(
data,
prop = 0.01,
x = progress,
y = vocabulary,
by = doc_id,
descriptive_labels = TRUE,
feature = hapax_doc
)Arguments
- data
A tidy data frame, potentially containing columns called "doc_id" and "word"
- prop
The proportion of hapax to sample. The chart can become illegible with proportions over ~1%
- x
A column showing the cumulative progress of documents
- y
The Y-axis variable to chart. Default value is the cumulative vocabulary size.
- by
A grouping column, such as doc_id
- descriptive_labels
A toggle for disabling descriptive labels of progress_percent on the X-axis
- feature
The column to check for new features. Defaults to
hapax_doc, but the function might also be used withnew_wordinstead to plot a sample of new additions to documents' vocabularies.
Examples
if (FALSE) {
dubliners <- get_gutenberg_corpus(2814) |>
load_texts() |>
identify_by(part) |>
standardize_titles()
dubliners_measured <- dubliners |>
add_vocabulary()
dubliners_measured |>
plot_hapax()
}
