This function is used to generate the coded levels of FLDNAME using
a data dictionary dataset DATADIC()
downloaded from
<https://adni.loni.usc.edu/data-samples/adni-data/>.
Usage
get_factor_levels_datadict(
.datadic,
tbl_name = NULL,
nested_value = FALSE,
spliter1 = ";| ;| ; ",
spliter2 = "=| =| = "
)
Arguments
- .datadic
Data dictionary dataset
- tbl_name
Table name, Default: NULL that generate for all available TBLNAMEs in the data_dict
- nested_value
Unnest the factor level variables in long format if TRUE otherwise nested with CODES variable.
- spliter1
First split parameter/pattern, Default:";| ;| ; "
- spliter2
Second split parameter/pattern, Default: "=| =| = "
Value
A data.frame that appended with the following variables:
prefix: Actual value in the dataset
suffix: Coded values from
DATADIC()
class_type: Class type, "factor"
See also
Other data dictionary related functions:
extract_codelist_datadict()
,
get_factor_fldname()
Examples
if (FALSE) { # \dontrun{
get_factor_levels_datadict(
.datadic = ADNIMERGE2::DATADIC,
tbl_name = NULL,
nested_value = TRUE
)
} # }