This text from an RStudio tutorial will help you get an idea of what ggplot is all about:
ggplot2has a rich underlying theory: the Grammar of Graphics, proposed by Leland Wilkinson. The grammer is based on of composition of building blocks according to certain rules. Statistical graphics are viewed as layers, each consisting of 4 elements:
- Mapping between variables and aesthetics (e.g. color, shape,scale)
- Geometric Objects (e.g. points, lines, polygons)
- Statistical Transformation (e.g. smoothing, binning in a histogram)
The user can explicitly specify these layers, and put them together according to the rules of the grammar. Layers can be saved or shared between plots, as they have a high-level representation in the code.
The lecture and exercises: rclub-ggplot2.r
Full ggplot documentation can be helpful.
As we’ve seen in a previous post, this package is pretty powerful for a variety of data viz needs (and desires).