Written by the creator of ggplot2, this book teaches the grammar of graphics that underlies the package, so you can think about a plot in terms of how each component of your data is represented visually rather than memorizing chart types.
It is for anyone who has struggled to display data clearly and attractively, and it requires only basic R knowledge, such as how to import data.
The second edition, published alongside ggplot2 2.0.0, is a substantial update.
It shows much more code so it works better as a reference, introduces plotting with ggplot() rather than qplot(), and adds practice exercises throughout.
The toolbox chapter now covers all the new geoms, with a new section on text labels and expanded material on maps, and the scales chapter has been rewritten around the most important tasks, including finer control over legends.
The data analysis chapter is now three parts: tidying data with tidyr, manipulating it with dplyr, and visualizing models with broom.
Throughout, the book points to the wider ecosystem of packages built around ggplot2.
With this book you will learn how to:
- Build plots layer by layer from points, lines, maps, tiles, box plots, and more
- Combine layers from different data sources with automatically aligned scales and legends
- Add smoothers based on linear models, loess, generalized additive models, and robust regression
- Customize scales, axes, and legends
- Use faceting and coordinate systems to arrange and compare data
- Create custom themes that match in-house or journal styles
- Prepare data and visualize models with
tidyr,dplyr, andbroom
