Top 20 n-grams from an ngram_freq result as a horizontal bar chart.
Shares its bar-building logic with sframe_plot_term_frequency()'s bar
path via the internal .sframe_plot_term_bar() helper; unlike that
function, there is no word-cloud mode and no group faceting for this id.
Usage
sframe_plot_ngram_frequency(result, palette = c("web", "print"))Arguments
- result
An
ngram_freqresult list fromrun_analysis_plan().- palette
One of
"web"or"print". Seesframe_brand().
Examples
# \donttest{
if (requireNamespace("ggplot2", quietly = TRUE)) {
demo <- sframe_demo("open_text")
res <- run_analysis_plan(demo$responses, demo$instrument)
sframe_plot_ngram_frequency(res$RQ2)
}
#> Warning: K=2 is equivalent to a unidimensional scaling model which you may prefer.
# }