importQualtrics: Import Qualtrics survey files, apply clean column names

importQualtricsR Documentation

Import Qualtrics survey files, apply clean column names

Description

Defaults are based on most common format received from Qualtrics downloads to CSV or XLSX (MS Excel) formats. We assume that the file has the column names in row 1 and that 3 rows are skipped before the real data begins. If the parameter questrow is used, it designates a row that is interpreted as the survey questions themselves. Often, this is in row 2.

Usage

importQualtrics(
  file,
  namerow = 1,
  questionrow = 2,
  importidrow = 3,
  skip = 3,
  dropTEXT = TRUE,
  stringsAsFactors = FALSE
)

Arguments

file

file name (including path if in another directory) of a CSV or XLSX file from Qualtrics.

namerow

Row number for variable names. Default 1, the information to be used as column names (same as HEADER row in R's read.table function)

questionrow

Row number to be treated as the questions in the survey. Default is 2. If questions do not seem to be present in this row, there will be a warning.

importidrow

Row number to be treated as Qualtrics meta data. Default is 3. Many CSV created by Qualtrics will have row 3 with a character string such as "{""ImportId"":""QID1303_4""}". If importids are not present in this row, there will be a warning.

skip

Number of rows that are meta data. Current Qualtrics CSV files will usually have 3 metadata rows, 1 = name, 2 = question, 3 = ImportId. This function will try to guess how many rows of metadata are present. skip should be at least as large as max(namerow, questions, and importids)

dropTEXT

Default TRUE, columns ending in "_TEXT" are omitted.

stringsAsFactors

Default FALSE, same meaning as R's read.csv. Does not affect importation of Excel files.

Value

Data frame that has attribute "meta"

Author(s)

Paul Johnson <pauljohn@ku.edu>


kutils documentation built on Sept. 17, 2023, 5:06 p.m.