Learn R Programming

sentopics (version 0.7.4)

plot.sentopicmodel: Plot a topic model using Plotly

Description

Summarize and plot a sentopics model using a sunburst chart from the plotly::plotly library.

Usage

# S3 method for sentopicmodel
plot(x, nWords = 15, layers = 3, sort = FALSE, ...)

Value

A plotly sunburst chart.

Arguments

x

a model created from the LDA(), JST() or rJST() function and estimated with fit()

nWords

the number of words per topic/sentiment to display in the outer layer of the plot

layers

specifies the number of layers for the sunburst chart. This will restrict the output to the layers uppermost levels of the chart. For example, setting layers = 1 will only display the top level of the hierarchy (topics for an LDA model).

sort

if TRUE, sorts the plotted topics in a decreasing frequency.

...

not used

See Also

topWords() LDAvis()

Examples

Run this code
lda <- LDA(ECB_press_conferences_tokens)
lda <- fit(lda, 100)
plot(lda, nWords = 5)

# only displays the topic proportions
plot(lda, layers = 1)

Run the code above in your browser using DataLab