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

bookChallenge: Clean Messy Text Data

Oppgave

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.

Løsning

Alt var klart?

Hvordan kan vi forbedre det?

Takk for tilbakemeldingene dine!

Seksjon 1. Kapittel 4
single

single

Spør AI

expand

Spør AI

ChatGPT

Spør om hva du vil, eller prøv ett av de foreslåtte spørsmålene for å starte chatten vår

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

Sveip for å vise menyen

Oppgave

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.

Løsning

Switch to desktopBytt til skrivebordet for virkelighetspraksisFortsett der du er med et av alternativene nedenfor
Alt var klart?

Hvordan kan vi forbedre det?

Takk for tilbakemeldingene dine!

Seksjon 1. Kapittel 4
single

single

some-alt