qualtricsColumns: qualtricsColumns

Description Usage Arguments Value

Description

Runs a desired function on multiple columns of a data frame with similar column names (ex. Q1_1, Q1_2, ...). Defaults are useful for Qualtrics data structures.

Usage

1
2
3
qualtricsColumns(df, q, id, dfQuestions = NULL, category = "Category",
  func = NULL, remove = c(NA, NaN, NULL, "", "-99"), questionChar = "-",
  charInQ = 0, includeRespondent = FALSE, ...)

Arguments

df

main data frame

q

string representing question name (ex. "Q1_")

id

vector specifying columns (1,2,3...)

dfQuestions

data frame with same columns as df - contains question strings

category

name of category to print in final data

func

function to run on cleaned data. An example could be fixing text (removing a ":") or converting to a different class. Default is no function.

remove

vector of strings/objects to remove from each column (ex. NA, NaN)

questionChar

character to help specify data in the question. Default is "-", which Qualtrics uses to show the question options.

charInQ

number of times that questionChar shows up in the question.

includeRespondent

If true, adds a column to the output specifying the row from the original data frame.

Value

a data frame containing one row for each response that was not removed. The data frame can be quickly summarized or tabled, or graphed using EMI functions.


mnblonsky/REMI documentation built on May 23, 2019, 5:06 a.m.