Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Apprendre Challenge: Write a Readable Pipeline | Pipes and Chaining Operations
Data Manipulation in R (Core)

bookChallenge: Write a Readable Pipeline

You have learned how to use pipes to streamline your data manipulation code and how best practices like clear formatting and comments can make pipelines much easier to read and maintain. Now, you will put these skills to the test by refactoring a messy and hard-to-follow pipeline into a clean, well-documented sequence of operations for a realistic data cleaning scenario. This exercise will challenge you to apply everything you have learned about writing readable, professional pipelines in R.

Tâche

Swipe to start coding

Refactor the provided messy pipeline so that it is clean, readable, and well-commented for the given customer data cleaning scenario.

  • Remove rows where customer_id is missing.
  • Trim whitespace from first_name and last_name columns.
  • Filter to keep only rows where status is "active".
  • Create a new column full_name by combining first_name and last_name.
  • Arrange the rows by signup_date in descending order.

Solution

Tout était clair ?

Comment pouvons-nous l'améliorer ?

Merci pour vos commentaires !

Section 2. Chapitre 6
single

single

Demandez à l'IA

expand

Demandez à l'IA

ChatGPT

Posez n'importe quelle question ou essayez l'une des questions suggérées pour commencer notre discussion

close

bookChallenge: Write a Readable Pipeline

Glissez pour afficher le menu

You have learned how to use pipes to streamline your data manipulation code and how best practices like clear formatting and comments can make pipelines much easier to read and maintain. Now, you will put these skills to the test by refactoring a messy and hard-to-follow pipeline into a clean, well-documented sequence of operations for a realistic data cleaning scenario. This exercise will challenge you to apply everything you have learned about writing readable, professional pipelines in R.

Tâche

Swipe to start coding

Refactor the provided messy pipeline so that it is clean, readable, and well-commented for the given customer data cleaning scenario.

  • Remove rows where customer_id is missing.
  • Trim whitespace from first_name and last_name columns.
  • Filter to keep only rows where status is "active".
  • Create a new column full_name by combining first_name and last_name.
  • Arrange the rows by signup_date in descending order.

Solution

Switch to desktopPassez à un bureau pour une pratique réelleContinuez d'où vous êtes en utilisant l'une des options ci-dessous
Tout était clair ?

Comment pouvons-nous l'améliorer ?

Merci pour vos commentaires !

Section 2. Chapitre 6
single

single

some-alt