Challenge: 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.
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_idis missing. - Trim whitespace from
first_nameandlast_namecolumns. - Filter to keep only rows where
statusis"active". - Create a new column
full_nameby combiningfirst_nameandlast_name. - Arrange the rows by
signup_datein descending order.
Solution
Thanks for your feedback!
single
Ask AI
Ask AI
Ask anything or try one of the suggested questions to begin our chat
Awesome!
Completion rate improved to 4.17
Challenge: Write a Readable Pipeline
Swipe to show 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.
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_idis missing. - Trim whitespace from
first_nameandlast_namecolumns. - Filter to keep only rows where
statusis"active". - Create a new column
full_nameby combiningfirst_nameandlast_name. - Arrange the rows by
signup_datein descending order.
Solution
Thanks for your feedback!
single