Learn R Programming

dataquieR (version 2.1.0)

util_parse_assignments: Utility function to parse assignments

Description

This function parses labels & level assignments in the format 1 = male | 2 = female. The function also handles m = male | f = female, but this would not match the metadata concept. The split-character can be given, if not the default from SPLIT_CHAR is to be used, but this would also violate the metadata concept.

Usage

util_parse_assignments(
  text,
  split_char = SPLIT_CHAR,
  multi_variate_text = FALSE,
  split_on_any_split_char = FALSE
)

Value

the parsed assignments as a named list

Arguments

text

Text to be parsed

split_char

Character separating assignments, may be a vector, then all will be tried and the the most likely matching one will be returned as attribute split_char of the result.

multi_variate_text

don't paste text but parse element-wise

split_on_any_split_char

split on any split split_char, if > 1 given.

See Also

Other parser_functions: util_interpret_limits(), util_interpret_range(), util_parse_interval(), util_parse_redcap_rule()

Examples

Run this code
if (FALSE) {
md <- prep_get_data_frame("meta_data")
vl <- md$VALUE_LABELS
vl[[50]] <- "low

Run the code above in your browser using DataLab