Chapter 5. Visualizing Data with ggplot2

This chapter covers the following topics:

  • Creating basic plots with ggplot2
  • Changing aesthetics mapping
  • Introducing geometric objects
  • Performing transformations
  • Adjusting plot scales
  • Faceting
  • Adjusting themes
  • Combining plots
  • Creating maps

Introduction

When analyzing data, our primary goal is to efficiently and precisely deliver the findings to our audience. An easy way to present data is to display it in a table format. However, for larger datasets, it becomes challenging to visualize data in this format.

For example, the following table contains regional sales data:

Region

Jul-12

Aug-12

Sep-12

Oct-12

Nov-12

Dec-12

Alberta

22484.08

65244.19

15946.36

38593.39

34123.56

34753.98

British Columbia

23785.05 ...

Get R for Data Science Cookbook 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.