case_list_formatter_df_gen: Formatter customized for cases in the data.frame.

Description Usage Arguments Value

Description

Parameters are the same as for generic_df_formatter_gen, only the default values are slightliy different. The real difference is in the closure returned: it accepts casenames (either string or integers). The formatter outputs all variables encountered in the data.frame, so remove all unwanted variables before supply the data.frame.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
case_list_formatter_df_gen(df, case_name_var = NULL, case_names = NULL,
  attr_rows = character(0),
  variable_numeral = English_numeral$new(singular = "case", plural =
  "cases", flag_skip_one = FALSE), flag_include_raw_name = TRUE,
  all_except_infix_fn = all_except_infix_fn_en,
  threshold_for_inversion = 0.8,
  item_ellipsis_fn = item_ellipsis_fn_en, max_explicit_items_count = 7,
  number_of_elements_around_ellipsis = c(3, 2), txt_separator = ", ",
  txt_separator_last = " and ", txt_attribute_separator = ", ",
  txt_attribute_separator_last = " and ", txt_attribute_prefix = " (",
  txt_attribute_suffix = ")", txt_attribute_bare_quote = "`",
  txt_attribute_label_quote = "", txt_attribute_infix = ": ")

Arguments

all_except_infix_fn

Function that can create a description of complementary notation in a natural language. The arguments are described later. Default function writes in English text "all items except for", using the item_numeral for the word "items".

threshold_for_inversion

Number between 0 and 1 that describes the threshold of percentage of selected items to trigger a complementary notation.

item_ellipsis_fn

Function that can create an ellipsis notation in the middle of a long list. Defaults to a function that displays text ", 13 items more, " (assuming the item_numeral is for the noun "item").

max_explicit_items_count

Maximal number of items to be ever displayed in comma separated list. Ellipsis notation will be used, if number of items exceed this value.

number_of_elements_around_ellipsis

Number of elements around the actual ellipsis, when the ellipsis is used. Must be a two element integer vector. Defaults to c(3,2) to produce text like "item1, item2, item3, 5 items more, item9 and item10"

txt_separator

String that separates list elements for all but last item. Defaults to ", ".

txt_attribute_separator

Simmilar to txt_separator, but for the attributes of a single item (if there are any). Defaults to ", ".

txt_attribute_separator_last

Simmilar to txt_separator_last, but for the attributes of a single item (if there are any). Defaults to "\uA0and ".

txt_attribute_prefix

String that gets pasted at the beginning of the attribute list. Defaults to "\ua0(".

txt_attribute_suffix

String that gets pasted at the beginning of the attribute list. Defaults to ")".

txt_attribute_bare_quote

If the attribute name is available only in its internal name (its label is not specified), this string will get pasted before and after. Defaults to markdown code "‘". This may be extended in future to allow formatting in different markup languages, which don’t use symmetric quotes, like LaTeX ("\verbatim\{" and \code"}").

txt_attribute_label_quote

The same as txt_attribute_bare_quote but for labelled attributes. Defaults to empty string.

txt_attribute_infix

The string that will be inserted between the attribute name and its value. Defaults to ":\uA0".

Value

A closure that turns a data.frame into a formatted list (as string)


adamryczkowski/itemNaming documentation built on June 9, 2019, 11:44 a.m.