IniziaInizia gratis

Summarizing by continent and year

Instead of grouping just by year, or just by continent, you'll now group by both continent and year to summarize within each.

Questo esercizio fa parte del corso

Introduction to the Tidyverse

Visualizza il corso

Istruzioni dell'esercizio

  • Find the median life expectancy (lifeExp) and maximum GDP per capita (gdpPercap) within each combination of continent and year, saving them into medianLifeExp and maxGdpPercap, respectively.

Esercizio pratico interattivo

Prova a risolvere questo esercizio completando il codice di esempio.

library(gapminder)
library(dplyr)

# Find median life expectancy and maximum GDP per capita in each continent/year combination
Modifica ed esegui il codice