Description Usage Arguments Details Value See Also
Visualize token sentiment log ratios across pairs of facet
values.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | visualize_sentratios_facet_by2_at(data = NULL, token = NULL, facet = NULL,
xy_nms, xy_grid, cnt_min = 10, lexicon = "bing", ...,
filter_facet = TRUE, facet_main = NULL,
filter_facet_base = default_filter_facet(facet_main),
filter_facet_params = list(), filter_sent = TRUE, sent_main = NULL,
color = NULL, lab_other = ifelse(!is.null(facet_main), paste0("Not ",
facet_main), "Other"), num_top = 5, color_main = "grey50",
scale_manual_base = default_scale_manual(generate_named_dual_colors(color_main,
facet_main, lab_other)), scale_manual_params = list(),
labs_base = default_labs(), labs_params = list(title =
"Most Significant Words Contributing\nto Sentiment Differences", y =
"Log Odds Ratio"), theme_base = default_theme(),
theme_params = list(legend.position = "bottom", axis.text.y =
ggplot2::element_text(angle = 30, hjust = 1), panel.grid.major.y =
ggplot2::element_blank()),
facet_base = default_facet(ifelse(is.null(sent_main), c("sentiment",
"name_xy"), "name_xy")), facet_params = list())
visualize_sentratios_facet_by2(..., token, color, facet)
|
data |
data.frame. Data to apply a function over. |
token |
bare for NSE; character for SE. Name of column in |
facet |
character. Name of column in |
xy_nms |
character (vector). Values to use to create a 'grid' of all combinations of values. |
xy_grid |
data.frame. Output from |
cnt_min |
numeric. If not null, serves as a filter for which to compute log ratios. |
lexicon |
character. Specifies lexicon to use. Must be a lexicon available in the |
... |
dots. Additional parameters to pass to |
filter_facet |
logical. Whether or not to filter the |
facet_main |
of same type as |
filter_facet_base |
stuff. Work similarly to other |
filter_facet_params |
list. Works similarly to other |
filter_sent |
logical. Whether or not to filter the sentiment values. |
sent_main |
bare for NSE; character for SE. Name of single sentiment value to use as basis.
Not used if |
color |
bare for NSE; character for SE. Name of column in |
lab_other |
character. Name to give to 'opposing' factor of |
num_top |
numeric. Number of tokens to show for each |
color_main |
character. Opposite color is calculated for 'opposing' color.
It is advised to use this argument instead of setting |
scale_manual_base |
list. Parameters to pass to |
scale_manual_params |
list. Additional parameters to pass to |
labs_base |
|
labs_params |
list. Additional parameters to pass to |
theme_base |
|
theme_params |
list. Additional parameters to pass to |
facet_base |
|
facet_params |
list. Additional parameters to pass to |
compute_sentratios_facet_by2_at()
should NOT be called beforehand.
gg.
https://www.tidytextmining.com/twitter.html#comparing-token-usage. http://varianceexplained.org/r/trump-tweets/. https://www.tidytextmining.com/sentiment.html#most-positive-negative.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.