Description Usage Arguments Value See Also Examples
Read a predefined survey list and variables.
1 2 3 4 5 6 | subset_save_surveys(
var_harmonization,
selection_name = "trust",
import_path = "",
export_path = "working"
)
|
var_harmonization |
Metadata of surveys, including at least
|
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. |
The function does not return a value. It saves the subsetted surveys into .rds files.
Other import functions:
pull_survey()
,
read_dta()
,
read_rds()
,
read_spss()
,
read_surveys()
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | 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())
file.exists ( file.path(tempdir(), "ZA7576_tested.rds"))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.