Combining filter, mutate, and arrange
In this exercise, you'll combine all three of the verbs you've learned in this chapter, to find the countries with the highest life expectancy, in months, in the year 2007.
Deze oefening maakt deel uit van de cursus
Introduction to the Tidyverse
Oefeninstructies
- In one sequence of pipes on the
gapminderdataset: filter()for observations from the year 2007,mutate()to create a columnlifeExpMonths, calculated as12 * lifeExp, andarrange()in descending order of that new column
Praktische interactieve oefening
Probeer deze oefening eens door deze voorbeeldcode in te vullen.
library(gapminder)
library(dplyr)
# Filter, mutate, and arrange the gapminder dataset