Session Ready
Exercise

Exercise 14. Infant mortality scatter plot - part 4 - comparison of scatter plots

Now we are going to look at changes in the infant mortality and dollars per day patterns African countries between 1970 and 2010.

Instructions
100 XP
  • Generate dollars_per_day using mutate and filter for the years 1970 and 2010 for African countries.
    • Remember to remove NA values.
  • As in the previous exercise, make a scatter plot of infant_mortality versus dollars_per_day for countries in the African continent.
  • As in the previous exercise, use color to denote the different regions of Africa.
  • As in the previous exercise, transform the x axis to be in the log (base 2) scale.
  • As in the previous exercise, add a layer to display country names instead of points.
  • Use facet_grid to show different plots for 1970 and 2010. Align the plots vertically.