Exercise: Compare life expectancy

Create a line graph to compare the life expectancy lifeExp in the countries Japan, Brazil and India.

  1. Use the data set gapminder_comparison in your ggplot() function which contains only data for the countries Japan, Brazil and India.
  2. Create a line graph with the geom_line() function
  3. Map the year to the x-axis and the life expectancy lifeExp to the y-axis with the aes() function
  4. Map the group and the color parameter to the country variable.
Output

Submit code to see output here.

Create a line graph with ggplot