Filtering for one year
The filter verb extracts particular observations based on a condition. In this exercise you'll filter for observations from a particular year.
Deze oefening maakt deel uit van de cursus
Introduction to the Tidyverse
Oefeninstructies
- Add a
filter()line after the pipe (%>%) to extract only the observations from the year 1957. Remember that you use==to compare two values.
Praktische interactieve oefening
Probeer deze oefening eens door deze voorbeeldcode in te vullen.
library(gapminder)
library(dplyr)
# Filter the gapminder dataset for the year 1957
gapminder %>%