This function replaces specified missing codes in a data frame with NA
values based on a given variable codebook.
Usage
ReplaceMissingCode(DataFrame, VariableCodebook)
Arguments
- DataFrame
A data frame containing the data.
- VariableCodebook
A data frame containing the variable codebook. It should have columns Variable
and MissingCode
, where Variable
specifies the variable name in the data frame and MissingCode
specifies the code to be replaced with NA
.
Value
A data frame with specified missing codes replaced by NA
.