single
Challenge: Data Wrangling Workflow
Stryg for at vise menuen
Imagine you are working with a dataset that contains information about sales transactions from a small retail shop. The data arrives in a messy form: some values are missing, column names are inconsistent, and there are duplicate rows. Your goal is to apply a complete data wrangling workflow using Tidyverse tools in R. You will need to import (simulate) the data, clean it by renaming columns and removing duplicates, transform it by creating new variables and handling missing values, and finally summarize the sales by product category to provide insights for the shop owner.
Stryg for at begynde at kode
You are given a simulated messy dataset representing sales transactions. Your task is to apply a complete data wrangling workflow using Tidyverse functions to clean, transform, and summarize the data.
- Rename the columns to consistent, tidy names.
- Remove duplicate rows from the dataset.
- Replace missing values in the
sales_amountcolumn with 0 and remove rows with missingdate_sold. - Create a new variable
sales_amount_usdby multiplyingsales_amountby 2. - Summarize the total sales in USD by product category.
Løsning
Tak for dine kommentarer!
single
Spørg AI
Spørg AI
Spørg om hvad som helst eller prøv et af de foreslåede spørgsmål for at starte vores chat