Description Usage Arguments Details Value Examples
The function harmonizes the variable names of surveys (of class survey
) that
are imported from an external file as a wave with with read_surveys
.
1 | subset_waves(waves, subset_names = NULL)
|
waves |
A list of surveys imported with |
subset_names |
The names of the variables that should be kept from all surveys in the list that contains the
wave of surveys. Defaults to |
It is likely that you want to harmonize the variable names with harmonize_var_names
first.
The list of surveys with harmonized variable names.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | examples_dir <- system.file("examples", package = "retroharmonize")
survey_list <- dir(examples_dir)[grepl("\\.rds", dir(examples_dir))]
example_surveys <- read_surveys(
file.path( examples_dir, survey_list),
save_to_rds = FALSE)
metadata <- metadata_waves_create(example_surveys)
metadata$var_name_suggested <- label_normalize(metadata$var_name)
metadata$var_name_suggested[metadata$label_orig == "age education"] <- "age_education"
hnw <- harmonize_var_names(waves = example_surveys,
metadata = metadata )
subset_waves (hnw, subset_names = c("uniqid", "w1", "age_education"))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.