read_surveys {retroharmonize} | R Documentation |
Read Survey Files
Description
Import surveys into a list. Adds filename as a constant to each element of the list.
Usage
read_surveys(import_file_names, .f = "read_rds", save_to_rds = FALSE)
Arguments
import_file_names |
A vector of file names to import. |
.f |
A function to import the surveys with.
Defaults to |
save_to_rds |
Should it save the imported survey to .rds?
Defaults to |
Details
The functions handle exceptions with wrong filenames and not readable files. If I file cannot be read, a warning is given, and empty survey is added to the the list in the place of this file.
Value
A list of the surveys. Each element of the list is a data
frame-like survey
type object where some metadata,
such as the original file name, doi identifier if present, and other
information is recorded for a reproducible workflow.
See Also
survey
Other import functions:
pull_survey()
,
read_dta()
,
read_rds()
,
read_spss()
,
subset_save_surveys()
Examples
file1 <- system.file(
"examples", "ZA7576.rds", package = "retroharmonize")
file2 <- system.file(
"examples", "ZA5913.rds", package = "retroharmonize")
read_surveys (c(file1,file2), .f = 'read_rds' )