Description Usage Arguments Details Value See Also Examples
The function harmonizes the variable names of surveys (of class survey) that 
are imported from an external file as a wave.
| 1 2 3 4 5 6 7 | harmonize_var_names(
  waves,
  metadata,
  old = "var_name_orig",
  new = "var_name_suggested",
  rowids = TRUE
)
 | 
| waves | A list of surveys imported with  | 
| metadata | A metadata table created by  | 
| old | The column name in  | 
| new | The column name in  | 
| rowids | Rename var labels of original vars  | 
If the metadata that contains subsetting information is subsetted, then 
it will subset the surveys in 
waves.
The list of surveys with harmonized variable names.
Other harmonization functions: 
collect_val_labels(),
harmonize_na_values(),
harmonize_values(),
label_normalize(),
suggest_permanent_names(),
suggest_var_names()
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | 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 <- lapply ( X = example_surveys, FUN = metadata_create )
metadata <- do.call(rbind, metadata)
metadata$var_name_suggested <- label_normalize(metadata$var_name)
metadata$var_name_suggested[metadata$label_orig == "age education"] <- "age_education"
harmonize_var_names(waves = example_surveys, 
                    metadata = metadata )
 | 
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.