plot.sentopicmodel: Plot a topic model using Plotly

View source: R/methods.R

plot.sentopicmodelR Documentation

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 class 'sentopicmodel'
plot(x, nWords = 15, layers = 3, sort = FALSE, ...)

Arguments

x

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

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

Value

A plotly sunburst chart.

See Also

topWords() LDAvis()

Examples

lda <- LDA(ECB_press_conferences_tokens)
lda <- grow(lda, 100)
plot(lda, nWords = 5)

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

sentopics documentation built on May 31, 2023, 8:26 p.m.