Figure_Out_Groups: Figure out the groups questions belong to, when there is a...

Figure_Out_GroupsR Documentation

Figure out the groups questions belong to, when there is a capped number in any given group

Description

If there is a cap on the number of subquestions, you'll want to know which groups each subquestion belongs to, and you'll want to split them up sensibly and give them proper names/create their associated questions. This function helps you figure out their group belonging.

Usage

Figure_Out_Groups(
  Questions_to_Group,
  max_number = 50,
  grouping_variable,
  even_split = TRUE
)

Arguments

Questions_to_Group

data.table with the question information and, most importantly, a grouping variable (grouping_variable)that specifies which subquestions belong to which group.

max_number

default is 50 (max number currently allowed by LS)- this is the largest number of subquestions allowed in any given group

grouping_variable

this is a character string that specifies which variable should be used for grouping.

even_split

this is a boolean input that specifies whether you want the function to try to give you (more or less) even sized groups or not. Default is TRUE. FALSE would mean that there will be lists that go up to the max_number and then (possibly) one list that could be significantly shorter- e.g. you have 201 subquestions in a group- this would make 5 groups, four of which would have 50 and the last one would have 1. If you had the same situation and even_split was true you'd end up with 5 groups that have 41 subquestions each, and one with 37- 5 groups in total.

Examples

## Not run: 
 Figure_Out_Groups(Questions_to_Group = Questions, max_number = 20, grouping_variable = "industry", even_split = TRUE)

## End(Not run)

bpresentati/surveyR documentation built on March 19, 2022, 3:40 a.m.