Exercise 1.2

Code

Questions

  1. Try summarizing the data with a different function for one or more of the variables.
  1. What is the median value of polyarchy for The West?
  2. What is the max value of gdp_pc for Eastern Europe?
  3. What is the standard deviation of flfp for Africa?
  4. What is the interquartile range of women_rep for the Middle East?
  1. Now try grouping by country instead of region.
  1. What is the median value of polyarchy for Sweden?
  2. What is the max value of gdp_pc New Zealand?
  3. What is the standard deviation of flfp for Spain?
  4. What is the interquartile range of women_rep for Germany?
  1. Sort countries in descending order based on the mean value of gdp_pc (instead of the median value of polyarchy). Which country ranks first based on this sorting?

  2. Now try sorting countries in ascending order based on the median value of women_rep (hint: delete “desc” from the arrange() call). Which country ranks at the “top” of the list?