2.4 Learn more

The ggplot framework has become extremely popular, and there are a lot of excellent resources for learning more about how to use it. Many of these are through the website bookdown.org, which hosts a collection of free, author-submitted online books, mostly about R programming.

R for Data Science is a global look at effectively using R’s “tidyverse”, including sections on plotting with ggplot2. Kiernan Healy’s Data Visualization: A Practical Introduction is a great book on using R for plotting, with extensive examples in R. This book also covers a lot of the principles of creating effective and attractive plots—it’s well worth reading.

If you want to dig deeper into plotting in R using the ggplot framework, you might want to take a look at the official ggplot2 book, ggplot2: Elegant Graphics for Data Analysis and at Paul Murrell’s book R Graphics, with extensive coverage of the grid graphics system that ggplot2 builds on.

Finally, one of the best ways to learn more is to check out RStudio’s “Data Visualization” cheatsheet,19 cheatsheet. A two-sided, one-page sheet crammed with all the main functions for a particular topic of coding. RStudio has a large collection available here, including cheatsheets for cleaning data, working with factors and strings, and a range of other topics. This webpage also includes “contributed” cheatsheets, developed by people outside of RStudio. Once you’ve started to get the hang of the basics of plotting in R, download this cheatsheet and work through the examples. All of them use datasets that come with R, so you should be able to run them all, and you’ll get a good idea of the range of plots ggplot2 can be used to create.