Introduction
Filtering by row
Extracting data by column
Practice using filter() and select()
The pipe operator
Sorting rows
Summary
27. Exercise 2

Instruction

Let's start with selecting filtered information from countries.

Exercise

First, filter countries from Africa and North America; then, select the population and country_name columns.

Stuck? Here's a hint!

Do what we did in the previous exercises, then pass the result by pipe operator to select().

Type:

countries %>%
  filter(continent %in% c("Africa", "North America")) %>%
  select(country_name, population)