2.6 Summary

ds4psy: (2) Visualizing data

This chapter introduced basic ways of visualizing tabular data using the ggplot2 package.

After working through this chapter, you should be able to:

  1. explain why we should always aim for a transparent visualization of data;
  2. know the basic structure of a ggplot() function call;
  3. distinguish between various types of visualizations (e.g., histograms, bar charts, scatterplots, line plots);
  4. use different geoms to create these plots;
  5. adjust the aesthetic properties (e.g., colors, shapes) of plots;
  6. adjust the axes, legends, and titles of plots.

We only scratched the surface of the ggplot2 package, as this includes many more commands and options (aesthetics, geoms, scales, statistics, etc.). Take a look at the Posit cheatsheets on data visualization to check which commands you are now familiar with and which others you can still discover in the future:

Data visualization with ggplot2 summary from Posit cheatsheets.

Figure 2.8: Data visualization with ggplot2 summary from Posit cheatsheets.

Let’s test our knowledge and skills by completing the following exercises.