A Rule governs how an output in Displayr, such as a chart or table, appears. The simplest rules are essentially identical to Conditional Formatting in Excel. For example, the chart below shades the cells proportional to the values.
Rules can also be used to manipulate the contents of outputs. In the example below, the sample size is inserted into each column heading.
The process is as follows:
- The main table output is generated, which incorporates:
- Statistics selected by using the table context menu and the toolbar
- Any changes to the row or column question's categories, including re-ordering, renaming, merging, etc. - any operation done via the table context menu and the toolbar
- If there are any STATISTICS > Right selected, another table output is generated for the table on the right, which is merged with the main table output later.
- If there are any STATISTICS > Below selected, another table output is generated for the table below, which is merged with the main table output later.
- The multiple comparison correction is performed, generating the Corrected p and Multiple Comparison Adjustment statistics (which affect displays of significance).
- Cell significance is calculated, determining arrow length and font color.
- The sample size description (shown in the table's footer) is calculated from the table's cell statistics (Count, Sample Size, etc.).
- If you apply a Rule to a basic non-R-based chart in Displayr, or convert a table to this type of chart, the changes are effectively applied to the underlying table first and then carried over to the chart where applicable. The following chart types are the most compatible with Rules:
- Bar/Column/Line charts
- Stacked column/bar charts
- Grid of bars charts