data <- read.csv("superstore.csv")
#head(data)
total_sales <- sum(data$Sales)
total_profit <- sum(data$Profit )
total_quantity <- sum(data$Quantity)
total_orders <- n_distinct(data$`Order ID`)
valueBox(format(round(total_sales, 0), big.mark = ","), "Total Sales", icon = "fa-dollar-sign", color = "green")
2,297,201
valueBox(format(round(total_profit, 0), big.mark = ","), "Total Profit", icon = "fa-chart-line", color = "blue")
286,397
valueBox(total_quantity, "Total Quantity", icon = "fa-boxes", color = "orange")
37873
valueBox(total_orders, "Total Orders", icon = "fa-shopping-cart", color = "purple")
0
```{r} ### segment_sales <- data %>% group_by(Year, Segment) %>% summarise(Sales = sum(Sales, na.rm = TRUE)) %>% ungroup()
ggplot(segment_sales, aes(x = Year, y = Sales, color = Segment)) + geom_line(size = 1) + geom_point() + labs(title = “Yearly Sales by Segment”, x = “Year”, y = “Sales”) + theme_minimal() + scale_color_brewer(palette = “Dark2”)