qualtricsMatrix: qualtricsMatrix

Description Usage Arguments Value

Description

Runs a desired function on an array of columns of a data frame with similar column names (ex. Q_1_1, Q_1_2, ..., Q_2_1, Q_2_2, ...). Defaults are useful for Qualtrics data structures.

Usage

1
2
3
qualtricsMatrix(df, q, id1, id2, dfQuestions, func = NULL, remove = c(NA,
  NaN, NULL, "", "-99"), questionChar = "-", charInQ = 0, charInCol = 0,
  ...)

Arguments

df

main data frame

q

string representing question name (ex. "Q")

id1

vector specifying the row numbers (1,2,3...)

id2

vector specifying the column numbers (1,2,3...)

dfQuestions

data frame with same columns as df - contains question strings

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 unused part of the question.

charInCol

number of times that questionChar shows up in the column names part of the question (the last part).

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.