Exercise: Reproduce Gapminder scatter plot

Try to reproduce the following plot:

  1. Use the ggplot() function and specify the gapminder_2007 dataset as input
  2. Add a geom_point layer to the plot and create a scatter plot showing the GDP per capita gdpPercap on the x-axis and the life expectancy lifeExp on the y-axis
  3. Use the color aesthetic to indicate each continent by a different color
  4. Use the size aesthetic to adjust the point size by the population pop
  5. Use scale_size_area() so that the point sizes reflect the actual population differences and set the max_size of each point to 15
  6. Set the opacity/transparency of each point to 70% using the alpha parameter

Submit code to see output here.

Specify additional aesthetics for points