© Thomas Mailund 2019
Thomas MailundR Data Science Quick Referencehttps://doi.org/10.1007/978-1-4842-4894-2_12

12. Plotting: ggplot2

Thomas Mailund1 
(1)
Aarhus, Denmark
 

The ggplot2 package contains a vast number of functions for creating a wide variety of plots. It would take an entire book to cover it all—there are already several that cover it—so I cannot attempt this here. In this chapter, I will only try to give you a flavor of how the package works.

The ggplot2 package is loaded when you load tidyverse, but you can always include it on its own using
library(ggplot2)

The Basic Plotting Components in ggplot2

Unlike in R’s base graphics, with ggplot2 you do not create individual plot components by drawing lines, points, or whatever you need onto a ...

Get R Data Science Quick Reference: A Pocket Guide to APIs, Libraries, and Packages 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.