
Replace Values for Single Variable Across Multiple Phase
Source:R/utils.R
replace_values_single_var.Rd
This function is used to replace values for a single column in the dataset across different ADNI study phases.
Arguments
- .data
Data frame
- fld_name
Variable name
- phaseVar
Variable name for the ADNI study protocol, Default: "PHASE"
- input_values
A list value associated with each ADNI study phase and the format will be [phase_name]$values.
code: Value that will be replaced, see more
collect_value_mapping_single_var()
decode: Values that will replace the coded values,
code
See also
Other functions to replace values:
convert_to_missing_value()
,
replace_values_dataset()
,
replace_values_phase_specific()
Examples
if (FALSE) { # \dontrun{
data_dict_dd <- get_factor_levels_datadict(
data_dict = ADNIMERGE2::DATADIC,
tbl_name = NULL,
nested_value = TRUE
)
input_values <- collect_value_mapping(
data_dict = data_dict_dd,
tbl_name = "REGISTRY",
all_fld_name = "VISTYPE"
)
input_values <- input_values$VISTYPE
result_dataset <- replace_values_single_var(
.data = ADNIMERGE2::REGISTRY,
phaseVar = "COLPROT",
fld_name = "VISTYPE",
input_values = input_values
)
} # }