products <- read.csv("product_info.csv")
analysis_data <- head(products, 4247)
The dataset is the Sephora product information dataset from Kaggle. It contains 8,494 observations and 27 variables. I used the first 4,247 observations for my analysis, which is approximately half of the original dataset. It contains information about beauty products, brands, prices, ratings, reviews, and product categories.
category_counts <- table(analysis_data$primary_category)
category_counts
##
## Bath & Body Fragrance Hair Makeup Men
## 207 778 785 1020 58
## Mini Size Skincare Tools & Brushes
## 131 1250 18
barplot(category_counts,
main = "Number of Products by Category",
xlab = "Product Category",
ylab = "Number of Products",
col = "skyblue",
las = 2)
library(ggplot2)
ggplot(analysis_data, aes(x = rating, y = price_usd)) +
geom_point(col = "blue") +
xlab("Product Rating") +
ylab("Price in USD") +
ggtitle("Product Price by Rating")
## Warning: Removed 118 rows containing missing values or values outside the scale range
## (`geom_point()`).
## What I Learned
The bar graph shows that skincare and makeup are the largest product categories in the sample, while categories such as Gifts and Tools & Brushes have fewer products. The scatterplot compares product ratings with prices and shows how prices are spread across different ratings. This could help a beauty retailer understand its product categories, pricing, and customer ratings.