Read a predefined survey list and variables.

subset_save_surveys(
  var_harmonization,
  selection_name = "trust",
  import_path = "",
  export_path = "working"
)

Arguments

var_harmonization

Metadata of surveys, including at least filename, var_name_orig, var_name, var_label.

selection_name

An identifier for the survey subset.

import_path

The path to the survey files.

export_path

The path where the subsets should be saved.

Value

The function does not return a value. It saves the subsetted surveys into .rds files.

See also

Other import functions: pull_survey(), read_rds(), read_spss(), read_surveys()

Examples

# \donttest{ test_survey <- read_rds ( file = system.file("examples", "ZA7576.rds", package = "retroharmonize") ) test_metadata <- metadata_create ( test_survey ) test_metadata <- test_metadata[c(18:37),] test_metadata$var_name <- var_label_normalize (test_metadata$var_name_orig) test_metadata$var_label <- test_metadata$label_orig saveRDS(test_survey, file.path(tempdir(), "ZA7576.rds"), version = 2) subset_save_surveys ( var_harmonization = test_metadata, selection_name = "tested", import_path = tempdir(), export_path = tempdir())
#> Saving ZA7576_tested.rds
file.exists ( file.path(tempdir(), "ZA7576_tested.rds"))
#> [1] TRUE
# }