Chapter 17

Creating Faceted Graphics with Lattice

In This Chapter

arrow Getting to know the benefits of faceted graphics

arrow Using the lattice package to create faceted plots

arrow Changing the colors and other parameters of lattice plots

arrow Understanding the differences between base graphics and lattice graphics

Creating subsets of data and plotting each subset allows you to see whether there are patterns between different subsets of the data. For example, a sales manager may want to see a sales report for different regions in the form of a graphic. A biologist may want to investigate different species of butterflies and compare the differences on a plot.

A single graphic that provides this kind of simultaneous view of different slices through the data is called a faceted graphic. Figure 17-1 shows a faceted plot of fuel economy and performance of motor cars. The important thing to notice is that the plot contains three panels, one each for cars with four, six, and eight cylinders.

R has a special package that allows you to easily create this kind of graphic. The package is called lattice and in this ...

Get R For Dummies now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.