Deals Of The Week - hours only!Up to 80% off on all courses and bundles.-Close
Filtering by row
Extracting data by column
Practice using filter() and select()
19. Subsetting rows and columns
The pipe operator
Sorting rows


Did you notice what we did? First, we filtered rows and assigned the results to a variable. Then, we selected columns. But actually, we can do all this in one step.

First, we will filter the Asian countries:

filter(countries, continent == "Asia")

From this set, we can choose the population and area columns. All together, this looks like:

select(filter(countries, continent == "Asia"), population, area) 


Select the population and area columns for all South American countries.

Stuck? Here's a hint!


select(filter(countries, continent == "South America"), population, area)