Exercise: Plot population size by country

Create a bar chart showing the population (in millions) of the five biggest countries by population in 2007.

  1. Use the ggplot() function and specify the gapminder_top5 dataset as input
  2. Add a geom_col() layer to the plot
  3. Plot one bar for each country (x aesthetic)
  4. Use population pop as bar height (y aesthetic)
  5. Use the GDP per capita gdpPerCap as fill aesthetic
Output

Submit code to see output here.

Create your first bar chart