This function merges a new survey wave into an old one while preserving variable labels and allowing flexible control over which variables are retained.
It provides two options for which variables to retain:
"New and shared old"(default): keeps all variables from the new dataset, plus shared variables from the old dataset, and any additional old-only variables specified inkeep_old."All": keeps all variables from both datasets.
Variable labels are reapplied after merging:
For variables present in the new dataset, labels are taken from
new_data.For old-only variables (when included), labels are taken from
old_data.
Usage
merge_waves(
new_data,
old_data,
vars = c("New and shared old", "All"),
keep_old = NULL
)