Sometimes, you may want to modify what data is shown on a visualization to add/remove certain categories. The easiest way is to do this without code via the object inspector under Data > Row Manipulations and Column Manipulations sections. There are lots of options for determining what data to show. It supports specific row/column names and positions, sample size thresholds, relative positions in the input table, other calculations listing what to show, and using a control to toggle what to show based on the user's selections. This article describes various methods of how to filter in/out the rows/columns shown in Displayr's Visualizations and Paste/Enter Table outputs, including:
Method 1 - Hide empty rows/columns
Method 2 - Hide rows/columns with small sample sizes
Method 3 - Display specific rows and columns
Method 4 - Hide specific rows and columns
Method 5 - Select which Rows and Columns to Show using Controls
Method 6 - Number of rows/columns from top/left to show
Method 7 - Number of rows/columns from bottom/right to show
Method 8 - Including NETs and Totals
Method 9 - Select what rows/columns to show via an R Calculation
For example, in this post, I have used the following table:
Requirements
- A Displayr Visualization, excluding Chart "with Test" Visualizations.
- A table created using the Table icon > Paste or Enter Table.
- Method 2 only: Column Sample Size, Column n, Sample Size, or Base n statistic.
Note: outputs mentioned above contain different types of filtering possibilities, which can be found in the object inspector under the Data > Row Manipulations and Column Manipulations:
Method 1 - Hide empty rows/columns
This option hides rows or columns that don't contain any data.
- Select the visualization or table on your Page.
- To hide empty rows, go to the object inspector > Data > Row Manipulations and select Hide empty rows.
To hide empty columns, go to the object inspector > Data > Column Manipulations and select Hide empty columns.
Method 2 - Hide rows/columns with small sample sizes
This option removes rows or columns with a low sample size as defined in Step 4.
- Ensure that the input source of the visualization or table contains one of the following statistics: Column Sample Size, Column n, Sample Size, or Base n (see requirements).
- Select the visualization or table on your Page.
- To hide rows with small sample sizes, go to the object inspector > Data > Row Manipulations and select Hide rows with small sample sizes.
To hide columns with small sample sizes, go to the object inspector > Data > Column Manipulations and select Hide rows with small sample sizes. - A Sample size cut-off dialog box will appear after completing the above step(s). Input the minimum sample size required for the data to appear (e.g., 30 responses).
Method 3 - Display specific rows and columns
- Select the visualization or table on your Page.
- To display specific rows, go to the object inspector > Data > Row Manipulations > Select Rows to show by and select Typing row names or indices.
To display specific columns, go to the object inspector > Data > Column Manipulations > Select Columns to show by and select Typing row names or indices.
- Input either row/column number you wish to show, separated by a comma (e.g., 1,2,3), or input the exact row/column labels you want to show, separated by a comma (e.g., Strongly disagree, Somewhat disagree).
Displayr will return a table showing rows 1, 2, and 3, and columns Strongly disagree and Somewhat disagree. All other rows and columns are hidden.
Method 4 - Hide specific rows and columns
By default, the NET, Total, and SUM rows/columns are hidden from the final output. To change the default settings:
- Select the visualization or table on your Page.
- To hide specific rows, go to the object inspector > Data > Row Manipulations > Rows to ignore.
To hide specific columns, go to the object inspector > Data > Column Manipulations > Columns to ignore.
-
Specify the rows/columns you wish to ignore by adding them to the list, referencing the name of the row/column, again separating each item by a comma.
Method 5 - Select which Rows and Columns to Show using Controls
See: How to Select Which Rows or Columns to Show in a Visualization Based on a Control Box Selection
Method 6 - Number of rows/columns from top/left to show
- Select the visualization or table on your Page.
- To specify the number of rows to show from the top, go to the object inspector > Data > Row Manipulations > Number of rows from the top to show.
To specify the number of columns to show from the left, go to the object inspector > Data > Column Manipulations > Number of columns from the left to show.
- Input the desired number of rows (e.g., 2) and columns to be shown (e.g., 3).
Displayr will return a table showing the first two rows and the first three columns from the left.
Method 7 - Number of rows/columns from bottom/right to show
- Select the visualization or table on your Page.
- To specify the number of rows to show from the bottom, go to the object inspector > Data > Row Manipulations > Number of rows from the bottom to show.
To specify the number of columns to show from the right, go to the object inspector > Data > Column Manipulations > Number of columns from the right to show.
- Input the desired number of rows (e.g., 2) and columns to be shown (e.g., 3).
Displayr will return a table showing the last two rows and the three columns from the right.
Method 8 - Ignoring rows/columns
There is a list of rows/columns to remove from the plot in the object inspector > Data tab under Row Manipulations > Rows to ignore or Column Manipulations > Columns to ignore. By default, NETs, Total, and Sum rows/columns are ignored and not plotted in visualizations. So to include the NET, you would simply remove it from the comma-delimited list. You can also add names of any other rows/columns you'd like to remove from the visualization as well (such as Don't Know, Other, Misc, etc), by adding the row/column name to the list separated by a comma.
Method 9 - Select what rows/columns to show via an R Calculation
See: How to Select and Order Rows or Columns to Show in a Visualization Based on a Calculation.
Next
How to Select Which Rows or Columns to Show in a Visualization Based on a Control Box Selection
How to Select and Order Rows or Columns to Show in a Visualization Based on a Calculation