Call the Library

{r} library(tidyverse) library(readxl) library(writexl)

Questions:

Which product categories has the most sales?

1. Use ‘bike_orderline_tbl’

{r} bike_orderline_tbl <- read_excel(path ="/cloud/project/Assignment/Exercises/bike_orderlines.xlsx")

2. Group and Summarize the data, calling the new column as ‘Sale’

```{r} sales_summary <- bike_orderline_tbl %>% group_by(Prime_category = category_1, Secondary_category = category_2, Frame_Material = frame_material) %>% summarise(Sales = sum(total_price))

sales_summary


## 3. Format the sales as 'dollars()'

```{r}
sales_summary <- sales_summary %>%
  mutate(Sales = scales::dollar(Sales))

sales_summary

4. Rename ‘category_1’ to ‘Prime category’, ‘category_2’ to ‘Secondary category’, ‘frame_material’ to ‘Frame Material’

```{r} sales_summary <- sales_summary %>% rename(“Prime category” = Prime_category, “Secondary category” = Secondary_category, “Frame Material” = Frame_Material)

sales_summary ```