Plot a heatmap of ranked features
Arguments
- df
A tidy data frame, potentially containing columns called "doc_id" and "word"
- rows
The ranks to show, not counting ties
- by
The column used for document grouping, with doc_id as the default
- feature
The column to measure, as in "word" or "lemma"
- label
Whether to show the rank as a label in the heatmap
See also
Other visualizing helpers:
change_colors(),
plot_bigrams(),
plot_doc_word_bars(),
plot_hapax(),
plot_hir(),
plot_tf_idf(),
plot_topic_bars(),
plot_topic_distributions(),
plot_topic_wordcloud(),
plot_ttr(),
plot_vocabulary(),
visualize()
Examples
dubliners <- get_gutenberg_corpus(2814) |>
load_texts(lemma = TRUE) |>
identify_by(part) |>
standardize_titles()
# Make a smaller example
selected_titles <-
c("The Sisters", "An Encounter", "Araby",
"Counterparts", "The Dead")
dubliners |>
dplyr::filter(doc_id %in% selected_titles) |>
plot_doc_word_heatmap()
dubliners |>
dplyr::filter(doc_id %in% selected_titles) |>
plot_doc_word_heatmap(feature = lemma, rows = 1:6)
