Learn R Programming

qualtRics (version 3.1.1)

read_survey: Read a CSV file exported from Qualtrics

Description

Reads comma separated CSV files generated by Qualtrics software. The second line containing the variable labels is imported. Repetitive introductions to matrix questions are automatically removed. Variable labels are stored as attributes.

Usage

read_survey(file_name, strip_html = TRUE, import_id = FALSE,
  legacy = FALSE)

Arguments

file_name

String. A CSV data file.

strip_html

Logical. If TRUE, then remove HTML tags. Defaults to TRUE.

import_id

Logical. If TRUE, use Qualtrics import IDs instead of question IDs as column names. Defaults to FALSE.

legacy

Logical. If TRUE, then import "legacy" format CSV files (as of 2017). Defaults to FALSE.

Value

A data frame. Variable labels are stored as attributes. They are not printed on the console but are visibile in the RStudio viewer.

Examples

Run this code
# NOT RUN {
# Generic use of read_survey()
df <- read_survey("<YOUR-PATH-TO-CSV-FILE>")
# }
# NOT RUN {
# Example using current data format
file <- system.file("extdata", "sample.csv", package = "qualtRics")
df <- read_survey(file)

# Example using legacy data format
file <- system.file("extdata", "sample_legacy.csv", package = "qualtRics")
df <- read_survey(file, legacy = TRUE)


# }

Run the code above in your browser using DataLab