This case study explores customer behavior patterns and sales trends from an e-commerce dataset using R. The goal was to gain basic insights into customer preferences, regions of activity, and general trends that could help improve business decisions.
To identify patterns and trends in customer purchases using the Online Retail dataset. The analysis focuses on a subset of countries due to visual clarity limitations and aims to highlight general behavior patterns through visual exploration.
- Source: Kaggle - Online Retail Dataset
- File:
OnlineRetail.xlsx - Observations: ~541,909 rows
- Attributes: 8 (InvoiceNo, StockCode, Description, Quantity, InvoiceDate, UnitPrice, CustomerID, Country)
- Language: R
- Packages:
dplyr,tidyr,ggplot2,maps,tidyverse - IDE: RStudio
-
Data Preprocessing
- Modified data types and converted relevant columns to factors
- Filtered out countries with too many entries to avoid cluttered visualizations
-
Data Subsetting
- Focused on countries like USA, Japan, and Canada
- Skipped countries like Germany and France due to overpacked plots
-
Visualization
- Created basic plots for country-level purchase trends
- Used the
mapspackage to experiment with a world map (work in progress)
- Only ~1500–2000 observations were used for plotting (country-wise subsets)
- Unable to use
StockCodeandDescriptioneffectively in plots - Could not establish meaningful correlations due to limited attribute variety
- Some plots (especially for countries with more data) were unreadable
- Insights are limited and not production-grade; more work is needed for decision-making relevance
This project served as a learning experience in working with real-world retail datasets and practicing data wrangling and visualization in R. While the results are limited, the process improved familiarity with key R packages and plotting challenges.