library(datasets)
data("bike_orderlines_tbl")
## Warning in data("bike_orderlines_tbl"): data set 'bike_orderlines_tbl' not
## found
summary("bike_orderlines_tbl")
##    Length     Class      Mode 
##         1 character character
  1. Use ‘bike_orderline_tbl’. install.packages(“dplyr”) install.packages(“scales”) library(dplyr) library(scales)

  2. Group and summarize the data calling the new column as ‘Sales’. result <- bike_orderlines_tbl %>% group_by(Prime category = category_1, Secondary category = category_2, Frame Material = frame_material) %>% summarize(Sales = sum(sales))

  3. Format the sales as ‘dollars()’.
    result\(Sales <- dollar(result\)Sales)

  4. Rename ‘category_1’ to ‘Prime category’, ‘category_2’ to ‘Secondary category’, ‘frame_material’ to ‘Frame Material’. colnames(result) <- c(‘Prime category’, ‘Secondary category’, ‘Frame Material’, ‘Sales’)