Chapter 4 Visualize

Communication is an essential part of data science. A key aspect of the successful communication of numerical or statistical results consists in creating transparent visualizations.

Most people conceptualize data as numeric information and think of R as a language for statistical computing. R is really good at that, of course, but there are many tools for doing statistics. An alternative motivation for using R relies on its immense graphical powers — not just for visualizations of data, but also for defining colors, illustrating mathematical constructs, designing charts and diagrams, and even creating computational artwork (e.g., the creative experiments at Fronkonstin).

Starting our own journey into data science by creating visualizations is a bit unususal. However, working with graphics is a great way of understanding how R scripts work (as we can see the effects of our commands) and provides students with an immediate sense of achievement. And although creating effective visualizations is challenging and effortful, it can also be very enjoyable.


Recommended background readings for this chapter include:

After reading this chapter, Chapter 2: Visualizing data of the ds4psy textbook (Neth, 2022a) provides an introduction to the ggplot2 package.


i2ds: Preflexions

Before you read on, please take some time to reflect upon the following questions:

  • Where do you usually encounter visualizations? Who created them?

  • What are the goals, benefits and dangers of visualizations?

  • What distinguishes good from bad visualizations?

  • Which types of visualizations do you know? What data do they require?


Baumer, B. S., Kaplan, D. T., & Horton, N. J. (2021). Modern Data Science with R (2nd ed.). Chapman; Hall/CRC.
Healy, K. (2018). Data visualization: A practical introduction. Princeton University Press.
Neth, H. (2022a). Data science for psychologists. Social Psychology; Decision Sciences, University of Konstanz.
Wilke, C. O. (2019). Fundamentals of data visualization: A primer on making informative and compelling figures. O’Reilly Media.