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.
This exercise is part of the course
Introduction to Tidyverse - Review
Exercise instructions
Using the gapminder
dataset, create a data frame of population by country, pop_by_country_2002
, as follows.
- Use the data from the year 2002.
- The populations should be converted to millions of people.
- The columns should be called
country
andpop_millions
; drop other columns. - 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 |
Hands-on interactive exercise
Turn theory into action with one of our interactive exercises
