read_surveys: Read Survey Files

Description Usage Arguments Details Value See Also Examples

Description

Import surveys into a list. Adds filename as a constant to each element of the list.

Usage

1
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 'read_rds'. For SPSS files, read_spss is recommended, which is a well-parameterized version of read_spss that saves some metadata, too.

save_to_rds

Should it save the imported survey to .rds? Defaults to FALSE.

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

1
2
3
4
5
6
file1 <- system.file(
    "examples", "ZA7576.rds", package = "retroharmonize")
file2 <- system.file(
    "examples", "ZA5913.rds", package = "retroharmonize")

read_surveys (c(file1,file2), .f = 'read_rds' )

retroharmonize documentation built on Nov. 3, 2021, 1:07 a.m.