Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Learn Challenge: Clean Messy Text Data | String Manipulation and Cleaning
Working with Text, Dates, and Data Cleaning in R

bookChallenge: Clean Messy Text Data

Task

Swipe to start coding

You are managing a customer contact list that contains user-entered email addresses in various formats. Some emails are invalid, and valid emails use different domain names. Your goal is to clean this list by filtering out invalid emails and standardizing all valid email addresses to use the domain "company.com".

  • Use grepl() to filter only valid email addresses from the input vector.
  • Use gsub() to replace the domain of each valid email with "company.com".
  • Return a vector containing the cleaned, standardized email addresses.

Solution

Everything was clear?

How can we improve it?

Thanks for your feedback!

SectionΒ 1. ChapterΒ 4
single

single

Ask AI

expand

Ask AI

ChatGPT

Ask anything or try one of the suggested questions to begin our chat

Suggested prompts:

Can you explain that in more detail?

What are the main benefits or drawbacks?

Can you give me an example?

close

bookChallenge: Clean Messy Text Data

Swipe to show menu

Task

Swipe to start coding

You are managing a customer contact list that contains user-entered email addresses in various formats. Some emails are invalid, and valid emails use different domain names. Your goal is to clean this list by filtering out invalid emails and standardizing all valid email addresses to use the domain "company.com".

  • Use grepl() to filter only valid email addresses from the input vector.
  • Use gsub() to replace the domain of each valid email with "company.com".
  • Return a vector containing the cleaned, standardized email addresses.

Solution

Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
Everything was clear?

How can we improve it?

Thanks for your feedback!

SectionΒ 1. ChapterΒ 4
single

single

some-alt