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

single

bookChallenge: Data Wrangling Workflow

Glissez pour afficher le menu

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.

Tâche

Glissez pour commencer à coder

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.

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 1. Chapitre 11
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

some-alt