getAllLabelsByGrouping: Retrieves the label for a graph.

Description Usage

View source: R/getLabel.R

Description

getAllLabelsByGrouping returns a multi line label containing all questions for all columns with the matching group and subgroup. This is done by first getting the names of all rows with the specified group and subgroup. We then search the data frame labels for columns with the same names. The contents of each column are placed into a list. Once all columns have been found, the list is turned into one big string and returned as the final label. The idea is that while questions might have the same group and subgroup, they might be phrased differently, and we want to display that difference. For example, "I hate bannanas." and "I hate apples" might both be in the same group and subgroup because we are testing how people feel about fruit - however, the two questions themselves are NOT the same, and we wish to show that. This function is meant to work with qualtrics data. Qualtrics data contains two extra rows at the top, the first of which contains the question asked to get the data for that column. The idea is that you peel that row off the data, and pass it into getLabelByOrg along with a column name, and will get back the question/label. To change when the label breaks, change the argument linesize.

Usage

1
2
3
4
5
6
7
8
getAllLabelsByGrouping(
  labels,
  group_name,
  subgroup_name,
  org,
  linesize = 100,
  ...
)

Eforberger/preview documentation built on Aug. 5, 2020, 9:02 p.m.