read_csv: Read csv file

View source: R/read_csv.R

read_csvR Documentation

Read csv file

Description

Import a survey from a csv file.

Usage

read_csv(file, id = NULL, doi = NULL, dataset_bibentry = NULL, ...)

Arguments

file

A path to a file to import.

id

An identifier of the tibble, if omitted, defaults to the file name without its extension.

doi

An optional document object identifier.

dataset_bibentry

A bibliographic entry created with dataset::dublincore or dataset::datacite.

...

Further optional parameters to pass on to utils::read.csv.

Value

A tibble, data frame variant with survey attributes.

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()
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"
)

retroharmonize documentation built on Jan. 14, 2026, 9:08 a.m.