Convert a study variable to a factor
util_study_var2factor(
resp_vars = NULL,
study_data,
meta_data = "item_level",
label_col = LABEL,
assume_consistent_codes = TRUE,
have_cause_label_df = FALSE,
code_name = c(JUMP_LIST, MISSING_LIST),
include_sysmiss = TRUE
)
study_data
converted to factors using the coding provided in
code_name
variable list the name of the measurement variables
data.frame the data frame that contains the measurements
data.frame the data frame that contains metadata attributes of study data
variable attribute the name of the column in the metadata with labels of variables
logical assume, that missing codes are consistent for all variables
logical is a missing-code table available
character all lists from the meta_data to use for the coding.
logical add also a factor level for data values
that were NA
in the original study data
(system missingness).
Other data_management:
util_assign_levlabs()
,
util_check_data_type()
,
util_check_group_levels()
,
util_compare_meta_with_study()
,
util_dichotomize()
,
util_merge_data_frame_list()
,
util_rbind()
,
util_remove_na_records()
,
util_replace_hard_limit_violations()
,
util_table_of_vct()