plot_top_words: Plot a single topic's most probable words

plot_top_wordsR Documentation

Plot a single topic's most probable words

Description

Creates a simple plot visualizing word weights in a topic as horizontal bars. The weightiest words appear at the top of the plot.

Usage

plot_top_words(frm, topic, n = NULL)

Arguments

frm

a data frame of topic top words, from top_words

topic

topic number

n

number of words to show on plot. If NULL (by default), use all the words supplied in frm

Value

a ggplot object

See Also

top_words

Examples

## Not run: 
top_words(m, n=10) %>%
     plot_top_words(m, topic=2)

# or with a different scoring scheme:
top_words (m, n=10, weighting=tw_blei_lafferty(m) %>%
     plot_top_words(m, topic=3)

## End(Not run)


agoldst/dfrtopics documentation built on July 15, 2022, 4:13 p.m.