Session Ready
Exercise

Tidyverse review

In this new exercise, you will review your skills from chapter 1 of Introduction to the Tidyverse by solving an exercise from scratch.

The gapminder dataset is available, but you’ll need to load any other library you want to use.

Instructions
100 XP

Using the gapminder dataset, create a data frame of population by country, pop_by_country_2002, as follows.

  1. Use the data from the year 2002.
  2. The populations should be converted to millions of people.
  3. The columns should be called country and pop_millions; drop other columns.
  4. Order the rows by descending population.

Print pop_by_country_2002 to see your result.

The first few rows should be:

country pop_millions
China 1280.400000
India 1034.172547
United States 287.675526