Get startedGet started for free

Detecting inconsistent text data

You've recently received some news that the customer support team wants to ask the SFO survey participants some follow-up questions. However, the auto-dialer that the call center uses isn't able to parse all of the phone numbers since they're all in different formats. After some investigation, you found that some phone numbers are written with hyphens (-) and some are written with parentheses ((,)). In this exercise, you'll figure out which phone numbers have these issues so that you know which ones need fixing.

dplyr and stringr are loaded, and sfo_survey is 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.

# Filter for rows with "-" in the phone column
sfo_survey %>%
  filter(___)
Edit and Run Code