© Margot Tollefson 2021
M. TollefsonVisualizing Data in R 4https://doi.org/10.1007/978-1-4842-6831-5_7

7. Graphics with the ggplot2 Package: An Introduction

Margot Tollefson1  
(1)
Stratford, IA, USA
 

The ggplot2 package in R provides a simpler way to create graphics than generating graphics with plot() and the ancillary functions of plot(). The default plots generated by the functions in ggplot2 also have a more sophisticated appearance than those plotted by default when using plot(). Also, some tasks that in plot() require several steps are easily coded by the functions available in the ggplot2 package.

The two functions in ggplot2 that initiate plotting are qplot() and ggplot(). The function qplot() is the ggplot2 version of plot(). The function ...

Get Visualizing Data in R 4: Graphics Using the base, graphics, stats, and ggplot2 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.