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.
Latihan ini adalah bagian dari kursus
Introduction to the Tidyverse
Petunjuk latihan
- Add a
filter()line after the pipe (%>%) to extract only the observations from the year 1957. Remember that you use==to compare two values.
Latihan interaktif praktis
Cobalah latihan ini dengan menyelesaikan kode contoh berikut.
library(gapminder)
library(dplyr)
# Filter the gapminder dataset for the year 1957
gapminder %>%