visualize_change: Visualize change

Description Usage Arguments Details Value

Description

Visualize the words that have changed the most across timebin

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
visualize_change_at(..., token = NULL, num_top = 5, color = token,
  add_labels = FALSE, scale_manual_base = default_scale_manual(values =
  rep("grey50", num_top)), scale_manual_params = list(),
  labs_base = default_labs(), labs_params = list(title =
  "Tokens with Most Significant Change in Frequency", caption =
  paste0("Statistical significance is determined by a logistical model\n",
  "estimating token appearance in a given time period.")),
  theme_base = default_theme(panel.grid.major.x = ggplot2::element_blank()),
  theme_params = list(legend.position = ifelse(add_labels, "none", "bottom")))

visualize_change(..., token, timebin, timefloor, color)

Arguments

...

dots. Parameters passed to compute_change_at().

token

bare for NSE; character for SE. Name of column in data to use as unit for counting. Probably something like 'word' or 'bigram'.

num_top

numeric. Number of words to show. If between 0 and 1, then assumed to be a percentage.

color

bare for NSE; character for SE. Name of column in data to use for color basis. Even if fill is the actual ggplot2 aesthetic, the internal code will 'coerce' this column to fill. In order to simplify internal code, MUST be specified.

add_labels

logical. Whether or not to add labels to the lines.

scale_manual_base

list. Parameters to pass to ggplot2::scale_fill_manual() or ggplot2::scale_color_manual(), depending on the aesthetic mapping. A default values argument is specified in the internal function default_scale_manual(), so if overwriting explicitly, then values should be included in the list.

scale_manual_params

list. Additional parameters to pass to ggplot2::scale_fill_manual() or ggplot2::scale_color_manual() (e.g. breaks, labels, or name). The default values specified by scale_manual_base = default_scale_manual() can be overwritten a values argument in this list (or directly with a values argument in the scale_manual_base list.

labs_base

ggplot2::labs() function. Defaults to a pre-determined set of values. It is recommended NOT to modify this argument; isntead, the _params argument should be used for customization.

labs_params

list. Additional parameters to pass to ggplot2::labs() to use in addition to and/or override the parameters set in the _base parameter.

theme_base

ggplot2::theme() function. (e.g. as ggplot2::theme_minimal().) A custom theme is supplied as a default. As with the the labs_base argument, it is NOT recommended to change this directly.

theme_params

list. Additional parameters to pass to ggplot2::labs(). Should be used in the same manner as labs_params for customization.

timebin

bare for NSE; character for SE. Name of column in data to use for time axis.

timefloor

character. Name of column passed directly to unit parameter of lubridate::floor_date() if bin = FALSE.

Details

Calls compute_change() internally. Works similarly to visualize_corrs. (Two data sets are returned from the list that is returned by the compute_ function.)

Value

gg.


tonyelhabr/tetext documentation built on May 14, 2019, 8:03 a.m.