Get startedGet started for free

Not a member

Now that you've practiced identifying membership constraint problems, it's time to fix these problems in a new dataset. Throughout this chapter, you'll be working with a dataset called sfo_survey, containing survey responses from passengers taking flights from San Francisco International Airport (SFO). Participants were asked questions about the airport's cleanliness, wait times, safety, and their overall satisfaction.

There were a few issues during data collection that resulted in some inconsistencies in the dataset. In this exercise, you'll be working with the dest_size column, which categorizes the size of the destination airport that the passengers were flying to. A data frame called dest_sizes is available that contains all the possible destination sizes. Your mission is to find rows with invalid dest_sizes and remove them from the data frame.

dplyr has been loaded and sfo_survey and dest_sizes are available.

This exercise is part of the course

Cleaning Data in R

View Course

Hands-on interactive exercise

Have a go at this exercise by completing this sample code.

# Count the number of occurrences of dest_size
sfo_survey %>%
  count(___)
Edit and Run Code