End of Summer - hours only!Up to 80% off on all courses and bundles.-Close
Filtering by row
7. NA – missing data
Extracting data by column
Practice using filter() and select()
The pipe operator
Sorting rows


Great! Let's talk for a moment about missing data. Datasets are rarely perfect, and missing values are a fact of life. As you know, R encodes missing data as NA. We can see which rows have missing data by using filter() with the is.na() function. When the is.na() function returns TRUE, we know there are missing values.

If we wanted to see which values in the urban_population column are missing from our dataset, we'd write:

filter(countries, is.na(urban_population))


Select rows with missing values in the water_area column.

Stuck? Here's a hint!


filter(countries, is.na(water_area))