library(tidyverse)
## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
## ✔ dplyr 1.1.4 ✔ readr 2.1.5
## ✔ forcats 1.0.0 ✔ stringr 1.5.1
## ✔ ggplot2 3.5.1 ✔ tibble 3.2.1
## ✔ lubridate 1.9.4 ✔ tidyr 1.3.1
## ✔ purrr 1.0.2
## ── 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(completejourney)
## Welcome to the completejourney package! Learn more about these data
## sets at http://bit.ly/completejourney.
library(dplyr)
library(tidyr)
library(lubridate)
Graph 1
transactions_sample %>%
mutate(week = lubridate::week(transaction_timestamp)) %>%
ggplot(aes(x = week, y = sales_value)) +
geom_point(alpha = 0.5, color = "blue") +
labs(title = "Weekly Sales Trends",
subtitle = "Analyzing Sales Patterns Across Weeks",
x = "Week of the Year",
y = "Total Sales Value",
caption = "Data Source: CompleteJourney") +
theme_minimal()

Graph 2
transactions_sample %>%
mutate(week = floor_date(transaction_timestamp, "week")) %>%
group_by(week) %>%
summarize(total_sales = sum(sales_value, na.rm = TRUE)) %>%
ggplot(aes(x = week, y = total_sales)) +
geom_line(color = "#0073C2", size = 1.5) +
geom_point(color = "#E69F00", size = 3) +
labs(title = "📅 Weekly Sales Trends",
subtitle = "Total sales per week show fluctuations over time",
x = "Week",
y = "Total Sales ($)",
caption = "Data Source: CompleteJourney") +
theme_minimal(base_size = 16) +
theme(
plot.title = element_text(face = "bold", size = 18),
axis.text = element_text(size = 14)
)
## Warning: Using `size` aesthetic for lines was deprecated in ggplot2 3.4.0.
## ℹ Please use `linewidth` instead.
## This warning is displayed once every 8 hours.
## Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
## generated.

Graph 3
transactions_sample %>%
left_join(products, by = "product_id") %>%
ggplot(aes(x = department, y = sales_value)) +
geom_boxplot(fill = "lightblue", color = "black", outlier.color = "red", ) +
labs(title = "Sales Value Distribution by Department",
subtitle = "Analyzing Variability Across Product Departments",
x = "Department",
y = "Sales Value",
caption = "Data Source: CompleteJourney") +
theme_minimal() +
theme(axis.text.x = element_text(angle = 45, hjust = 1))
