powered by
Creates a bar chart showing how many documents are assigned to each topic.
sm_plot_topic_frequency(model, dtm, threshold = 0.3)
A ggplot object.
A fitted topic model (LDA, STM, or CTM).
The document-term matrix used to train the model.
Minimum gamma probability for topic assignment. Default is 0.3.
if (FALSE) { # Requires trained model from sm_train_lda() lda_model <- sm_train_lda(dtm, k = 10) sm_plot_topic_frequency(lda_model, dtm) }
Run the code above in your browser using DataLab