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

single

bookChallenge: Data Wrangling Workflow

Sveip for å vise menyen

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.

Oppgave

Sveip for å begynne å 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_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 desktopBytt til skrivebordet for virkelighetspraksisFortsett der du er med et av alternativene nedenfor
Alt var klart?

Hvordan kan vi forbedre det?

Takk for tilbakemeldingene dine!

Seksjon 1. Kapittel 11
single

single

Spør AI

expand

Spør AI

ChatGPT

Spør om hva du vil, eller prøv ett av de foreslåtte spørsmålene for å starte chatten vår

some-alt