Rainbow Deals - hours only!Up to 80% off on all courses and bundles.-Close
Filtering by row
8. Non-NA subset
Extracting data by column
Practice using filter() and select()
The pipe operator
Sorting rows


Okay, but realistically, we probably want to exclude rows with missing data. The ! operator can do this. We simply add it to the is.na() function like this: !is.na(). This will return TRUE only if the data is not NA. Suppose we want to see urban population data without any missing values. We'd put:

filter(countries, !is.na(urban_population))


Subset all rows without missing values from the water_area column.

Stuck? Here's a hint!


filter(countries, !is.na(water_area))