Preparations

Before we can start with the graphical representations, we need to make some preparations.

First, load the dataset pss into your Environment. As a reminder, the dataset is directly available in the RStudio Cloud in the data folder or alternatively (if you are working locally) download it from here:

  • PSS_Codebook.pdf (94 KB)
  • pss.rds (63 KB)
  • ggplot is part of the tidyverse and thus compatible with the other libraries from tidyverse that we have used so far (dplyr and tidyr). A detailed description of the library and its functionality can be found here.

    In the learning module, all changes are made step by step, and you can always see them directly in the output of the graph. First, we will focus on four types of graphs, make extensions to them, and in the final chapter, create graphs according to the output of specific methods.

    To start with ggplot, you just need to load the library. You can do this either through tidyverse (recommended) or individually:

    # tidyverse
    library("tidyverse")
    
    # singulär
    library("ggplot2")