Topic-model top-terms plot: faceted bars, one facet per topic
Source:R/plots.R
sframe_plot_topics.RdServes both sframe_run_topic_model_lda() and sframe_run_stm_topics()
results with no dispatch on result$test: both runners emit a $table
with the same topic/term/beta columns (LDA's beta from
tidytext::tidy(), STM's from its fitted word-topic distribution), so
this function reads that shared shape directly.
Usage
sframe_plot_topics(result, palette = c("web", "print"))Arguments
- result
A
topic_model_ldaorstm_topicsresult list fromrun_analysis_plan().- palette
One of
"web"or"print". Seesframe_brand().
See also
sframe_run_topic_model_lda(), sframe_run_stm_topics()
Other Chart functions:
plot.sframe_analysis_results(),
sframe_plot_cooccurrence(),
sframe_plot_cooccurrence_network(),
sframe_plot_correlation_matrix(),
sframe_plot_decision_ranking(),
sframe_plot_dematel_influence(),
sframe_plot_descriptives(),
sframe_plot_efa_loadings(),
sframe_plot_efa_scree(),
sframe_plot_group_comparison(),
sframe_plot_likert_matrix(),
sframe_plot_likert_scale(),
sframe_plot_missingness(),
sframe_plot_ngram_frequency(),
sframe_plot_paired_comparison(),
sframe_plot_quality(),
sframe_plot_regression_diagnostics(),
sframe_plot_reliability(),
sframe_plot_sentiment(),
sframe_plot_term_frequency(),
sframe_plot_validity(),
sframe_plot_variable_distribution(),
sframe_plots,
theme_surveyframe()
Examples
# \donttest{
if (requireNamespace("ggplot2", quietly = TRUE) &&
requireNamespace("stm", quietly = TRUE) &&
requireNamespace("tidytext", quietly = TRUE)) {
demo <- sframe_demo("open_text")
res <- run_analysis_plan(demo$responses, demo$instrument)
sframe_plot_topics(res$RQ10)
}
# }