Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lära Challenge: Data Wrangling Workflow | Section
Data Wrangling with Tidyverse in R
Avsnitt 1. Kapitel 11
single

single

bookChallenge: Data Wrangling Workflow

Svep för att visa menyn

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.

Uppgift

Svep för att börja koda

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_amount column with 0 and remove rows with missing date_sold.
  • Create a new variable sales_amount_usd by multiplying sales_amount by 2.
  • Summarize the total sales in USD by product category.

Lösning

Switch to desktopByt till skrivbordet för praktisk övningFortsätt där du är med ett av alternativen nedan
Var allt tydligt?

Hur kan vi förbättra det?

Tack för dina kommentarer!

Avsnitt 1. Kapitel 11
single

single

Fråga AI

expand

Fråga AI

ChatGPT

Fråga vad du vill eller prova någon av de föreslagna frågorna för att starta vårt samtal

some-alt