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.
Lösning
Tack för dina kommentarer!
single
Fråga AI
Fråga AI
Fråga vad du vill eller prova någon av de föreslagna frågorna för att starta vårt samtal
Fantastiskt!
Completion betyg förbättrat till 4.17
Challenge: Write a Readable Pipeline
Svep för att visa menyn
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.
Lösning
Tack för dina kommentarer!
single