Introduction to Displayr 3: Creating Tables, Charts, and Other Visualizations
One of Displayr's unique strengths is the creation and presentation of tables, charts, and other visualizations. This post give a quick overview of the different ways of creating such outputs.
Creating summary tables with a single drag
The table shown in the screenshot below was created with a single operation. I clicked on Data Sets > "Preferred Cola", dragged it onto the page, and released my mouse. Displayr did the rest, working out from the label "Preferred Cola", which variable to tabulate. The metadata was also examined, with Displayr concluding that percentages should be shown.
Creating crosstabs with another drag
To turn the summary table into a crosstab, i.e. a table formed from two variable sets, we drag across a second variable set from Data. A form replaces the summary table, and you can release data into either the Rows box, which will replace the current summary table, or, you can release it into the Columns box, to create a crosstab. In the example below, "Age" has been added to Columns to to create the table. If you want to try this for yourself, click here.
Automated statistical testing
Displayr automatically puts statistics tests on tables created by dragging and dropping. Arrows and font colors are, by default, used to highlight interesting relationships that may warrant further investigation. Automated statistical testing may, however, not highlight important results, and may also highlight results that are neither important nor meaningful.
If you want to customize the statistical tests, then options are:
- Customize the default testing using Appearance > Significance.
- Choose additional tests from Insert > Analysis > More > Test.
- Use the various tests available in R: Insert > Analysis > R Output.
Categories on tables can be merged by dragging and dropping. First, click on a category. Then, when the "hamburger" appears (the three black horizontal lines), drag it onto another category. You can also move or re-order categories in the same way. Importantly, when you manipulate a table, you also manipulate the underlying data: all other analyses that use the same data will be automatically updated (see Understanding Variable Sets in Displayr: A Tutorial for more information).
Turning tables into charts
To create a chart, click on a table and select Home > Chart and then select the desired chart type.
Filtering tables and charts
Once you have created a table or a chart it is often useful to redo it with a subset of the data. As an example, you may want to show only the data from Texas. The most straightforward way to do this is to click on the table and chart and press Home > Data Selection > Filter, or, if no filters exist, Home > Data Selection > New Filter.
Creating novel visualizations
Displayr also supports countless novel visualizations. A few of them are available by point and click such as the palm trees below. These work a bit differently to the charts. Whereas with a chart you just click on a table, with a visualization you first insert the visualization (Insert > Analysis > Visualization), then you select the data. Typically, you will get a choice between selecting an existing table or entering new data as the Data source from the object inspector (see below).
Many more visualizations are available via R (Insert > Analysis > R Output). See HTMLwidgets.org for a showcase.
Other approaches to creating tables
There are three additional ways to create tables and charts:
- The most novel, and often most useful approach, is to create or modify the structure of variable sets, and then use the methods described above.
- Tables and charts are created by many of the advanced analyses methods in Insert > Analysis > More. For example, if you want to create a drilldown analysis (e.g., sales by region by product by time) use Insert > Analysis > More > Create Tables > Multiway Table .
- Use R (Insert > Analysis > R Output).
Keep in mind that how you create a table has a big impact on the options available for manipulating the table. Where you create tables by dragging and dropping from Data, the tables come with significance tests, the categories can be merged, the table can be filtered, and it can be turned into a chart. By contrast, where you create tables using the more advanced analysis methods or using R, the resulting tables are much less flexible.
If you wish to play around with the examples in this post, click here.
The next post in this series, Introduction to Displayr 4: Simple calculations, discusses how to perform additional analyses on tables (e.g., computing the average of the rows of a table).