Plot polarity scores of words
textplot_terms(
x,
highlighted = NULL,
max_highlighted = 50,
max_words = 1000,
sampling = c("absolute", "relative"),
...
)a fitted textmodel_lss object.
quanteda::pattern to select words to highlight. If a quanteda::dictionary is passed, words in the top-level categories are highlighted in different colors.
the maximum number of words to highlight. When
highlighted = NULL, words are randomly sampled proportionally to
beta ^ 2 * log(frequency) for highlighting.
the maximum number of words to plot. Words are randomly sampled to keep the number below the limit.
if "relative", words are sampled based on their squared deviation from the mean for highlighting; if "absolute", they are sampled based on the squared distance from zero.
passed to underlying functions. See the Details.
Users can customize the plots through ..., which is
passed to ggplot2::geom_text() and ggrepel::geom_text_repel(). The
colors are specified internally but users can override the settings by appending
ggplot2::scale_colour_manual() or ggplot2::scale_colour_brewer(). The
legend title can also be modified using ggplot2::labs().