do_list_extraction: Count the occurence of items in a list

Description Usage Arguments Value

View source: R/do_list_extraction.R

Description

Summarises the items in a list and provides a count of each. Missing values are replaced with "Missing".

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
do_list_extraction(
  this_data,
  this_var,
  add_total = TRUE,
  expand_levels = TRUE,
  order_by_vocab = FALSE,
  missing_data_limit = 10,
  this_function = NA,
  vocab_for_variables
)

Arguments

this_data

The tibble in which the column exists.

this_var

The column name (if not a quosure, it will be made into one).

add_total

If true, add a line to the table with the totals for all numeric columns (default=TRUE).

expand_levels

If true, include all levels of the factor, as defined in the glossary (i.e., as extracted from the DSD). Default = TRUE.

order_by_vocab

If true, present levels of the factor in the order defined parameter vocabulary (i.e., as extracted from the DSD). Default = FALSE

missing_data_limit

The limit for missing data, beyond which a warning is thrown.

this_function

A label for error/warning messages (by default it is the name of this function).

vocab_for_variables

The vocabulary for the parameters, as extracted via parse_MACRO_DSD_file()

Value

Counts of levels in the factor.


LisaHopcroft/CTutils documentation built on Oct. 7, 2021, 11:08 p.m.