Again, for your convenience, you can load the data for this exercise using the following code:

library(dplyr)
library(haven)

gp_covid <- 
  read_sav(
    "./data/ZA5667_v1-1-0.sav"
  ) %>% 
  sjlabelled::set_na(na = c(-1:-99, 97, 98))

1

Plot 4 bar plots of 4 variables of your choice from the data set in two rows and two columns.
You have to use the par() function in combination with its mfrow option.

That’s interesting. One may wonder what the median is in each of these distributions. You know what’s perfect for visualizing this statistic? Boxplots!

2

Use the same plotting approach, but change the barplot to a boxplot.
Creating the tables beforehand is not needed anymore.

3

Store the boxplots from the previous exercises combined in one png image.
The name of the function is the same as the file format we want for out output (with the required argument of a file path).

Before we later start with the other exercises, you should clean your graphics device with dev.off()

dev.off()
## RStudioGD 
##         2