Communicating with Graphics
Question 1
Use the gapminder
data set in the gapminder
library to recreate a version of the Hans Rosling’s famous data visualization (a single plot instead of a movie). You can revisit the slides from Grammar of Graphics to reference it.
Some guidelines:
- Plot the data for just a single year. You can see at a glance which years are available by running
count(gapminder, year)
. - Put
gdpPercap
on the x-axis andlifeExp
on the y-axis. - To distinguish the continents, you can use either shape or color. Which ever one you do not use, set its value to something other than the default.
- Alter the labels so that they’re more descriptive.
- Change to a theme of your choosing.
- Add an annotation that draws attention to a particular feature of the data.
Turn to the notes for today for guidance on how to add each of these elements.
Question 2
Recreate one of the plots that you created for Lab 2.2, but incorporate at least 3 of the 6 elements of Communicating with Graphics to polish your plot into one that tells a particular story.