HW02

Author

SC

Published

March 5, 2026

Compare the average literacy rate of genders on different continents in the earliest and the most recent year recorded

Saving your homework file

Please submit your homework into your HOMEWORK folder as a qmd file (that would be possible to render as an html or pdf) and name it yourlogin_HW02.qmd.

Data

DATA.NPFL112/gapminder_literacy.tsv

Continents are in the world4_region column.

Years

Filter the data frame to keep only the earliest and the most recent year. You do not have to care whether they contain exactly the same countries.

Boxplots and facets

Write a piece of code that produces a plot like below (or as similar as you can get and explain what your issue was if you get stuck). For the boxplots to “properly sit” on the x-axis ticks, you need to convert the time variable to a factor. You can do it directly in ggplot, as you can deduce from the title of the x-axis.