Visualize token log ratios across pairs of facet
values.
visualize_logratios_facet_by2_at(data = NULL, token = NULL, facet = NULL, xy_nms, xy_grid, ..., filter_facet = FALSE, facet_main = NULL, filter_facet_base = default_filter_facet(facet_main), filter_facet_params = list(), 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 Unique Words", 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("name_xy"), facet_params = list()) visualize_logratios_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 |
... | 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 |
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 |
gg.
compute_logratios_facet_by2_at()
should NOT be called beforehand.
https://www.tidytextmining.com/twitter.html#comparing-token-usage. http://varianceexplained.org/r/trump-tweets/.