Components of layered grammar
The grammar of graphics is a tool that allows us to effectively describe the components of a graph. In Chapter 1, Graphics in R, we mentioned some of the basic concepts behind the approach implemented in ggplot2
for data visualization. The ggplot2
package is an implementation of the ideas presented in the book, The Grammar of Graphics (Statistics and Computing) by Leland Wilkinson. The goal of the book was to define a set of general unifying principles for the visualization of data. For this reason, the plotting paradigm implemented in the package is based on the idea that, instead of providing many different functions, with each one targeting the realization of one specific type of graph, providing a smaller set of functions defines the different components of a graph and can be combined to generate a large variety of plots.
The grammar of graphics is designed to help in separating and identifying each step of the charting process, helping you to better decide...