44 Our World in Data Highlighting Excess Mortality
Readings
Chapter 11 Communication: R for Data Science (2nd ed)
Creating custom, stylized ggplot2
themes can get complicated very quickly. Finding answers and examples on Google is easier if you know what key words to search for. These reference sheets/pages helpful as you learn the ggplot
lingo..
Guided Instruction
The Our World in Data website publishes research and graphics that provide insight into world data. We are going to recreate one of their charts and use it to practice our annotation skills.
If the thing you want to edit is not a theme element, then it is related to data and can mostly likely be changed inside a geom_() or a scale_() layer.
- Recreate this graph as closely as you can. This will/should take the bulk of your time.
- The data is provided on the download tab.
- Focus your energy on the y-axis, axes, legend, lines, scales, etc. Pay attention to detail.
- Do NOT worry about making your graph interactive. Ignore that aspect completely
- To convert characters to dates you can use
lubridate::mdy()
. You can reorder the letters ‘m’, ‘d’, and ‘y’ in the code to match the order that the month, day and year are presented in the character string. - If you are getting stuck matching the graph exactly, try completing steps 2 and 3, then coming back to this step with the time you have left.
- Suppose we wanted to highlight (draw attention to) any points that are above 100%. Create two more graphs that show two different ways to highlight these points.
- Make one more graph that adds a line for the United States. Try highlighting the United States line using what you learned from the textbook.
- Write a paragraph summarizing insights you gained, or new skills/commands you learned in this task. Also reflect on how you can use “highlighting” to help the data tell a story.
- Render the
.qmd
file. Push all files created as part of the render to your GitHub repository.
Submit
In I-learn submit a link to the .md
file on GitHub.