Save up to $499! Grab all Python courses for $49 or all online courses we’ve ever launched for only $169. Only Feb 11-16. Happy Valentine's!
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)