get_SBS: FUN: get_sbs

Description Usage Arguments Value

View source: R/sbs_funs.R

Description

This function cleans up the columns in a SBS matrix so that is it really for joining and final plotting. If the matrices have difference choice options, AND factors are set to TRUE then it returns a list containing a DF for each sub matrix. Otherwise it returns a regular df. It's not ideal for a function to return 2 diff data types but in this instance, there may not be a better way if you want factors

Usage

1
2
3
4
5
6
7
get_SBS(
  quest_obj,
  quest_wrap = NULL,
  choice_wrap = NULL,
  choice_factor = FALSE,
  choice_rev = FALSE
)

Arguments

quest_obj

the object within the qsurvey object that contains all relevant information to the question including choicses and subquestions IF those are relevant

quest_wrap

an integer value defining the number of characters at which you want to specify a line break for each question at for prettier plotting. default = NULL which means no wrap

choice_wrap

an integer value defining the number of characters at which you want to specify a line break for each CHOICE at for prettier plotting. default = NULL which means no wrap

choice_factor

boolean set to TRUE if you want choices to be turned into a factor and ordered by the order provided in qualtrics (this is the order that you provided to the user in the survey)

choice_rev

boolean set to TRUE if you want to reverse the order of choices

Value

data.frame of choices ready to be merged


earthlab/qtoolkit documentation built on Feb. 3, 2022, 5:57 a.m.