Exercise

The tabplot package and grid graphics

The tabplot package allows you to tap into the power of grid graphics without explicit knowledge of how the system works under the hood. The main function in tabplot is tableplot(), developed to visualize data distributions and relationships between variables in large datasets.

Specifically, the tableplot() function constructs a set of side-by-side horizontal barplots, one for each variable. This function works best when viewing up to about 10 variables at a time, for datasets with arbitrarily many records. In this exercise, you are asked to apply this function to a dataset with just under 68,000 records and 11 variables.

The tableplot() function is called with a data frame and, if no optional arguments are specified, it selects the first data column as the reference variable. This variable can be of any type, but the display is easiest to explain when it's numeric, as in the example considered here.

For further details, refer to the vignette Visualization of large datasets with tabplot that accompanies the help files for the tabplot package.

Instructions

100 XP

Load the insuranceData package.

Use the data() function to load the dataCar data frame.

Load the tabplot package the normal way, but surround your call to library() with the suppressPackageStartupMessages() function to avoid a bunch of unncessary output from printing to the console.