Apply compute_logratios_facet_wide_at() to data in pairs of facet values, then do post-processing for sentiments.

compute_sentratios_facet_by2_at(data = NULL,
  func = compute_logratios_facet_wide_at, token = NULL, facet = NULL,
  xy_grid, xy_nms, cnt_min = 10, lexicon = "bing", ...)

compute_sentratios_facet_by2(..., token, facet)

Arguments

data

data.frame. Data to apply a function over.

func

function. Wrapped by do.call().

token

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

facet

character. Name of column in data to use for facetting. It is set to NULL by default in the non-facet function even though it is not necessary. If specified with the non-facet version of the function, then the function acts just like the _facet version.

xy_grid

data.frame. Output from create_xy_grid().

xy_nms

character (vector). Values to use to create a 'grid' of all combinations of values.

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 tidytext::package.

...

dots. Adddition parameters to pass to get_sents().

Value

data.frame.

Details

Calls wrapper_func internally. This function is very similar to compute_sentratios_facet_by2_at(), but with some post-processing. Note that ... are passed to get_sents() here (instead of to compute_logratios_facet_wide_at(), so token and cnt_min must be checked for NULL explicilty.