Sarantuya-Sharavsambuu-hw03.knit

install.packages(“dplyr”) install.packages(“tidyr”) install.packages(“stringr”) install.packages(“readr”) install.packages(“scales”) library(dplyr) library(tidyr) library(stringr) library(readr) # Corrected from readcsv library(scales) bike_orderline_tbl <- read_csv(“bike_orderlines.csv”) bike_orderline_tbl %>% group_by(category_1, category_2, frame_material) %>% summarise(Sales = sum(total_price, na.rm = TRUE)) %>% mutate(Sales = dollar(Sales)) %>% rename( Prime category = category_1, # Use backticks for columns with spaces Secondary category = category_2,
Frame Material = frame_material )