Import a survey dataset stored in comma-separated value (`.csv`) format and convert it into a survey-compatible tibble with reproducibility metadata retained as attributes.
Arguments
- file
Path to a `.csv` file.
- id
Optional dataset identifier. When omitted, the file name without extension is used.
- doi
Optional dataset DOI identifier.
- dataset_bibentry
Optional bibliographic metadata created with [dataset::dublincore()] or [dataset::datacite()].
- ...
Additional arguments passed to [utils::read.csv()].
Details
The imported object is returned as a tibble with additional survey metadata such as identifiers, DOI references, and optional dataset bibliographic metadata.
See also
Other import functions:
harmonize_survey_variables(),
pull_survey(),
read_dta(),
read_rds(),
read_spss(),
read_surveys()
Examples
# Create a temporary CSV file:
path <- system.file(
"examples",
"ZA7576.rds",
package = "retroharmonize"
)
read_survey <- read_rds(path)
test_csv_file <- tempfile(fileext = ".csv")
write.csv(
x = read_survey,
file = test_csv_file,
row.names = FALSE
)
# Read the CSV file:
re_read <- read_csv(
file = test_csv_file,
id = "ZA7576",
doi = "test_doi"
)
