Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lernen Challenge: Group and Summarise Regional Sales | Grouping and Aggregation in R
Data Manipulation in R (Core)

bookChallenge: Group and Summarise Regional Sales

In business analytics, you often need to summarize sales data by categories such as region to create concise, actionable reports. After learning how to use group_by() to segment your data, you are ready to apply grouping and summarization skills to a practical scenario: analyzing sales by region. This type of analysis helps businesses identify high-performing areas and target strategies more effectively.

Aufgabe

Swipe to start coding

Apply your grouping and summarization skills to analyze sales data by region. Your goal is to produce a summary that shows, for each region, the total and average sales.

  • Group the data by the region column.
  • For each region, calculate the sum of the sales column and store it as total_sales.
  • For each region, calculate the mean of the sales column and store it as average_sales.
  • Return a data frame with one row per region and columns for region, total_sales, and average_sales.

Lösung

War alles klar?

Wie können wir es verbessern?

Danke für Ihr Feedback!

Abschnitt 3. Kapitel 2
single

single

Fragen Sie AI

expand

Fragen Sie AI

ChatGPT

Fragen Sie alles oder probieren Sie eine der vorgeschlagenen Fragen, um unser Gespräch zu beginnen

close

bookChallenge: Group and Summarise Regional Sales

Swipe um das Menü anzuzeigen

In business analytics, you often need to summarize sales data by categories such as region to create concise, actionable reports. After learning how to use group_by() to segment your data, you are ready to apply grouping and summarization skills to a practical scenario: analyzing sales by region. This type of analysis helps businesses identify high-performing areas and target strategies more effectively.

Aufgabe

Swipe to start coding

Apply your grouping and summarization skills to analyze sales data by region. Your goal is to produce a summary that shows, for each region, the total and average sales.

  • Group the data by the region column.
  • For each region, calculate the sum of the sales column and store it as total_sales.
  • For each region, calculate the mean of the sales column and store it as average_sales.
  • Return a data frame with one row per region and columns for region, total_sales, and average_sales.

Lösung

Switch to desktopWechseln Sie zum Desktop, um in der realen Welt zu übenFahren Sie dort fort, wo Sie sind, indem Sie eine der folgenden Optionen verwenden
War alles klar?

Wie können wir es verbessern?

Danke für Ihr Feedback!

Abschnitt 3. Kapitel 2
single

single

some-alt