All of the variables in a set are analyzed together in tables and other features created in Displayr. Given this, you may want to modify how the variables are grouped into sets. The Combine command groups together variables if you want to include a newly created variable in the set, or if not all variables or data from the same question from your survey are in a set. Conversely, the Split command will split off any variables selected into individual variables outside the set. This is helpful when Displayr automatically groups too many similar variables together. This article outlines the basic function of each of these commands.
- Method - Combine > Do not merge variables
- Method - Combine > Grid
- Method - Combine > Merge Variables
- Method - Split variables
Requirements
- A Displayr document that contains a data source with multiple variables.
- Familiarity with variable set Structures and Value Attributes, see Variable Sets.
Method - Combine > Do not merge variables
If Displayr does not group variables together that should be grouped together or you want to add in a new variable to your set:
- Select the variables that should be grouped together in the Data Source. For example individual Text variables:
- To merge them together, right-click them and select Combine and this will combine those variables into one Variable Set. This is the same as choosing Combine > Do not merge variables. This will group together the variables into one set. In this example, a Text-Multi:
- OPTIONAL: If combining into a Binary set, you will see a warning in the object inspector about the values to be counted and they should be verified. Click on Fix. Review the Value Attributes and if they seem fine, click OK.
Method - Combine > Grid
When you have two sets with the same code frame and variables, you can combine the sets into a grid to see both sets broken out in the same table. There are other ways to create grid variable sets depending on how your data is organized, see How to Combine Separate Questions into a Grid in Displayr and How to Combine Variable Sets as a Grid for more detail.
- In the Data Sources tree, select the variable sets with the same code frame and variable labels that you want to combine:
- Right click and select Combine > Grid:
You will then see both sets broken out in the same table:
Method - Combine > Merge Variables
When you have two variables with mutually exclusive data (i.e. only one of the variables has data for each respondent), you can merge the actual data values into a single variable. You can also do this with variable sets if the variables contained within are labeled exactly for merging.
- In the Data Sources tree, select the variable sets with the same code frame and variable labels that you want to combine. For example two mutually exclusive variables have data like so:
- Right click and Combine > Merge Variables. You will get a new variable with the merged values:
Note that there are also checks built into Displayr when merging data. If the data is not completely mutually exclusive (i.e. the last case has fish and gorilla), the merge will insert a new category BOTH INPUT QUESTIONS HAVE DATA to alert you of the issue.
Method - Split variables
If Displayr incorrectly combines variables together or for other reasons, you may want to Split (rather than Delete) off a variable from the set into an individual variable:
- To break the variable set into its constituent variables, select the variable in the Data Set.
- Right-click and select Split. This will split the question out into individual variables.
- OPTIONAL: If you want to only remove specific variables from the set, you can select those variables individually at the same time holding down Ctrl and use the Split command.
Next
How to Combine Variable Sets as a Grid
How to Combine Variables into a Variables Set
How to Combine Separate Questions into a Grid in Displayr
How to Merge Mutually Exclusive Data Using R
How to Manipulate Strings Using JavaScript
How to Use Paste Functions to Create Dynamic Text Using R