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 plots (e.g., scatterplots, histograms, bar plots, line graphs);
  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 RStudio cheatsheet 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 RStudio cheatsheets.

Figure 2.7: Data visualization with ggplot2 summary from RStudio cheatsheets.

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