library(tidyverse)
## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
## ✔ dplyr 1.1.4 ✔ readr 2.1.5
## ✔ forcats 1.0.1 ✔ stringr 1.5.2
## ✔ ggplot2 4.0.0 ✔ tibble 3.3.0
## ✔ lubridate 1.9.4 ✔ tidyr 1.3.1
## ✔ purrr 1.1.0
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::filter() masks stats::filter()
## ✖ dplyr::lag() masks stats::lag()
## ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
library(lubridate)
library(scales)
##
## Attaching package: 'scales'
##
## The following object is masked from 'package:purrr':
##
## discard
##
## The following object is masked from 'package:readr':
##
## col_factor
## Load your file
bike_orderlines_wrangled_tbl <- read_rds("bike_orderlines(2).rds")
orders <- bike_orderlines_wrangled_tbl %>%
select(order_date, category_2, total_price) %>%
mutate(order_date = ymd(order_date),
sales = total_price)
ggplot(orders, aes(x = order_date, y = sales, color = category_2)) +
geom_line() +
geom_point(size = 1) +
facet_wrap(~ category_2, scales = "free_y") +
scale_y_continuous(labels = dollar_format()) +
labs(
x = "order_date",
y = "Sales"
) +
theme_minimal(base_size = 12) +
theme(
legend.position = "none",
strip.background = element_rect(fill = "#2F4050"),
strip.text = element_text(color = "white"),
panel.grid.minor = element_blank()
)
