##Introduction

The milestone showcases my ability to use R for data analysis and visualization. The analysis is based on a synthetic dataset I generated to mimic sales from my online art gallery, SHSWorks The Art Gallery. While simulated, the structure reflects realistic business data — including product types, product categories, selling platform, and revenues.

##The goal was to answer:

What are the sales & revenue trends over FY 2024–25?

Compare sales by selling platform over FY 2024–25.

Category-wise contribution in revenue over FY 2024–2025.

Top products by revenue generation.

Top selling product type. Note that the echo = FALSE parameter was added to the code chunk to prevent printing of the R code that generated the plot.

library(dplyr)
## 
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
## 
##     filter, lag
## The following objects are masked from 'package:base':
## 
##     intersect, setdiff, setequal, union
library(ggplot2)
library(scales)
library(lubridate)
## 
## Attaching package: 'lubridate'
## The following objects are masked from 'package:base':
## 
##     date, intersect, setdiff, union
library(tidyverse)
## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
## ✔ forcats 1.0.0     ✔ stringr 1.5.1
## ✔ purrr   1.1.0     ✔ tibble  3.3.0
## ✔ readr   2.1.5     ✔ tidyr   1.3.1
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ readr::col_factor() masks scales::col_factor()
## ✖ purrr::discard()    masks scales::discard()
## ✖ 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
# Load raw sales data
sales_data <- read.csv("sales_data.csv")

# Convert Date column
sales_data_iso <- sales_data %>%
  mutate(Date = as.Date(Date))

summary(sales_data_iso)
##       Date              Platform           Category         Product_Type      
##  Min.   :2024-04-02   Length:1000        Length:1000        Length:1000       
##  1st Qu.:2024-06-26   Class :character   Class :character   Class :character  
##  Median :2024-09-23   Mode  :character   Mode  :character   Mode  :character  
##  Mean   :2024-09-26                                                           
##  3rd Qu.:2024-12-25                                                           
##  Max.   :2025-03-31                                                           
##    Units_Sold        Price           Revenue       
##  Min.   :1.000   Min.   : 50.37   Min.   :  51.02  
##  1st Qu.:2.000   1st Qu.:165.28   1st Qu.: 365.42  
##  Median :3.000   Median :272.19   Median : 662.80  
##  Mean   :2.957   Mean   :273.63   Mean   : 793.45  
##  3rd Qu.:4.000   3rd Qu.:385.67   3rd Qu.:1138.69  
##  Max.   :5.000   Max.   :498.98   Max.   :2484.05

Import Analysis Code from Script

This pulls in your external R script where you created objects like monthly_revenue, Platform_plot, etc.

source("C:/Users/AA/Documents/R Practice/Google Analytics Capstone Project.R")
## Warning: package 'tidyverse' is in use and will not be installed
## 'data.frame':    1000 obs. of  7 variables:
##  $ Date        : chr  "06-03-2025" "11-10-2024" "29-03-2025" "25-02-2025" ...
##  $ Platform    : chr  "Website" "B2B" "Amazon" "Amazon" ...
##  $ Category    : chr  "Arabic Calligraphy" "Nature" "Abstract" "Abstract" ...
##  $ Product_Type: chr  "Original" "Reprint" "Original" "Reprint" ...
##  $ Units_Sold  : int  3 4 3 2 3 5 1 4 3 1 ...
##  $ Price       : num  444 250 290 223 468 ...
##  $ Revenue     : num  1331 1000 871 447 1403 ...
##  Date[1:1000], format: "2024-09-26" "2024-04-14" "2024-10-12" "2025-01-31" "2024-07-27" ...
## # A tibble: 12 × 2
##    month      total_revenue
##    <date>             <dbl>
##  1 2024-04-01        58697.
##  2 2024-05-01        75940.
##  3 2024-06-01        73832.
##  4 2024-07-01        69099.
##  5 2024-08-01        58853.
##  6 2024-09-01        73768.
##  7 2024-10-01        69103.
##  8 2024-11-01        77470.
##  9 2024-12-01        52966.
## 10 2025-01-01        58429.
## 11 2025-02-01        65047.
## 12 2025-03-01        60248.

##  num [1:1000] 493 836 413 1450 469 ...

Visualize Monthly Revenue Trend

Insights & Recommendations:

Revenue peaked around May-2024,Aug-2024 and again in Oct–Nov 2024 driven by bulk B2B sales.

These spikes suggest seasonal demand. Planspecial promotions, art exhibitions, or corporate campaigns during these high-revenue months.

Visualize Revenue From Different Platforms

Insights & Recommendations:

B2B sales dominate revenue, while Website sales provide consistent smaller contributions. Amazon shows growth potential for premium originals. Focus on strengthening B2B ties while scaling Amazon as a premium sales channel.

Visualize Revenue by Product Categories

Insights & Recommendations: +Nature is the strongest revenue-generating category. +Abstract and Contemporary perform well in high-value deals. +Arabic Calligraphy is gaining traction, especially on Amazon. Feature Nature in mainstream marketing, while positioning Abstract and Calligraphy as premium collections.

Visualize Revenue by Product Type

Insights & Recommendations: +Reprints drive steady volume and revenue stability. +Originals deliver brand prestige and higher margins. Maintain a balanced product mix: push Reprints for cash flow, Originals for brand growth.