cloud {stm} | R Documentation |
Plot a wordcloud
Description
Use the wordcloud package to plot a wordcloud for a particular topic
Usage
cloud(
stmobj,
topic = NULL,
type = c("model", "documents"),
documents,
thresh = 0.9,
max.words = 100,
...
)
Arguments
stmobj |
The STM model object to be used in making the word cloud. |
topic |
NULL to plot the marginal distribution of words in the corpus, or a single integer indicating the topic number. |
type |
Specifies how the wordcloud is constructed. The type
|
documents |
The documents object of the same kind as passed to
|
thresh |
The threshold for including a document in the
|
max.words |
The maximum number of words to be plotted. |
... |
Additional parameters passed to |
Details
Uses the wordcloud package to make a word cloud of a particular topic.
The option "model"
uses the topic-word model parameters. Thus it
shows words weighted by their probability conditional that the word comes
from a particular topic. With content covariates it averages over the
values for all levels of the content covariate weighted by the empirical
frequency in the dataset. The option "documents"
plots the words
which appear in documents that have a topic proportion higher than
thresh
. Thus "model"
gives a pure model based interpretation
of the topic while "documents"
gives a picture of all the words in
documents which are highly associated with the topic.
References
Ian Fellows (2014). wordcloud: Word Clouds. R package version 2.5. https://cran.r-project.org/package=wordcloud
See Also
Examples
cloud(gadarianFit, 1)