This report looks at video game sales data in order to compare the popularity of different genres, platforms, and regions. The goal here is to better understand which types of games appear most often, how genre preferences differ across platforms, and where the largest video game sales comes from globally.
The dataset contains information on over 16,000 video games and include many variables relating to each one, such as platform, genre, year of release, and sales across different regions. This allows for comparisons between game genres, platforms, and global sales patterns.
This section presents 5 visualizations examining video game genres, platforms, and regional sales.
This visualization shows the total number of video games in each genre. Action is the most common genre with over 3,000 games, followed by Sports with about 2.5k games. Puzzle and Strategy have the fewest games, with 580 and 683 respectively. This shows how the number of games released varies between genres by a considerable amount.
genrecount <- data.frame(count(games, Genre))
genrecount <- genrecount[order(genrecount$n, decreasing = TRUE),]
ggplot(genrecount[1:12, ], aes(x = reorder(Genre, -n), y = n)) +
geom_bar(colour = "black", fill = "gray76", stat = "identity") +
labs(title = "Number of Video Games by Genre", x = "Genre", y = "Number of Games") +
theme(plot.title = element_text(hjust = 0.5))
This visualization compares the distribution of genres across the 10 platforms with the largest number of games, with all remaining platforms combined into the “Other” category. PS2 and DS have the highest individual platform totals, with a little over 2,000 each. The “Other” category contains almost 3.5k games because it combines all of the platforms sitting outside of the top 10. The stacked sections also show differences between the types of games available of each platform. For example, Action and Sports make up a large portion of many platforms, whereas genres like Role-Playing and Miscellaneous vary more noticeably.
# Top 10 Plats
df_platforms <- count(games, Platform)
df_platforms <- df_platforms[order(df_platforms$n, decreasing = TRUE),]
top_platforms <- df_platforms$Platform[1:10]
new_df <- games %>%
filter(Platform %in% top_platforms) %>%
select(Platform, Genre) %>%
group_by(Platform, Genre) %>%
summarise(n = length(Genre), .groups = "keep") %>%
data.frame()
# Other Plats
other_df <- games %>%
filter(!Platform %in% top_platforms) %>%
select(Genre) %>%
mutate(Platform = "Other") %>%
group_by(Platform, Genre) %>%
summarise(n = length(Genre), .groups = "keep") %>%
data.frame()
new_df <- rbind(new_df, other_df)
new_df <- new_df %>%
filter(Genre !="")
# Total Number of Games per Plat
agg_tot <- new_df %>%
select(Platform, n) %>%
group_by(Platform) %>%
summarise(tot = sum(n), .groups = "keep") %>%
data.frame()
agg_tot <- agg_tot[order(agg_tot$tot, decreasing = TRUE),]
# Visualization 2
new_df$Genre <- as.factor(new_df$Genre)
max_y <- round_any(max(agg_tot$tot), 1000, ceiling)
ggplot(new_df, aes(x = reorder(Platform, n, sum), y = n, fill = Genre)) +
geom_bar(stat = "identity", position = position_stack(reverse = TRUE)) +
coord_flip() +
labs(title = "Video Game Genres by Platform", x = "", y = "Number of Games", fill = "Genre") +
theme_clean() +
theme(plot.title = element_text(hjust = 0.5)) +
scale_fill_brewer(palette = "Paired", guide = guide_legend(reverse = TRUE)) +
geom_text(data = agg_tot, aes(x = Platform, y = tot, label = comma(tot), fill = NULL), hjust = -0.1, size = 4) +
scale_y_continuous(labels = comma, breaks = seq(0, max_y, by = 500), limits = c(0, max_y))
This visualization looks at the genre distributions of the 8 largest platforms by separating each platform into it’s own graph. This makes specific differences between the platforms much easier to see. For example, Sports is the largest genre on PS2 with 400 games, while Action is the largest genre on PS3 and Xbox 360 with about 350 games each. Overall, the charts show that each platform has a different distribution of genres rather than all platforms following the same pattern.
# Top 8 Plats Genre Count
trellis_df <- games %>%
filter(Platform %in% top_platforms[1:8]) %>%
filter(Genre != "") %>%
select(Platform, Genre) %>%
group_by(Platform,Genre) %>%
summarise(n = length(Genre), .groups = "keep") %>%
data.frame()
trellis_df$Platform <- factor(trellis_df$Platform)
# Visualization 3
ggplot(trellis_df, aes(x = Genre, y = n, fill = Platform)) +
geom_bar(stat = "identity", position = "dodge") +
theme_light() +
theme(plot.title = element_text(hjust = 0.5)) +
theme(axis.text.x = element_text(angle = 90, hjust = 1)) +
scale_y_continuous(labels = comma) +
labs(title = "Multiple Bar Charts - Video Game Genre by Platform",
x = "Genre",
y = "Number of Games",
fill = "Platform") +
scale_fill_brewer(palette = "Set2") +
facet_wrap(~Platform, ncol = 4, nrow = 2)
This visualization shows the same 8 major platforms and genre counts as a heatmap, allowing the differences to be compared much more directly. Higher counts are represented by darker red cells, while lower counts are represented by ligher red/pink cells. Some of the largest values include 400 Sports games on PS2, 391 Miscellaneous games on DS, and 380 Action games on PS3. The heatmap, however, makes unusually low values easier to identify, such as 3 Puzzle games on PS3. This visualization reinforces that genre representation can differ based on the platform.
# Visualization 4
heatmap_df <- trellis_df
breaks <- c(seq(0, max(heatmap_df$n), by = 50))
ggplot(heatmap_df, aes(x = Platform, y = Genre, fill = n)) +
geom_tile(colour = "black") +
geom_text(aes(label = comma(n))) +
coord_equal(ratio = 1) +
labs(title = "Heatmap: Video Game Genres by Platform",
x = "Platform",
y = "Genre",
fill = "Number of Games") +
theme_minimal() +
theme(plot.title = element_text(hjust = 0.5)) +
scale_fill_continuous(low = "white", high = "red", breaks = breaks) +
guides(fill = guide_legend(reverse = TRUE, override.aes = list(colour = "black")))
This visualization shows how total video game sales in the dataset are divded between regions. Europe represents about 27% of sales, followed by Japan with about 14% of sales, whereas North America represents the largest portion of sales at almost 50%, showing that North America was the largest video game market represented in this dataset.
# Sales Data by Region
sales_df <- data.frame(
Region = c("North America", "Europe", "Japan", "Other"),
n = c(sum(games$NA_Sales),
sum(games$EU_Sales),
sum(games$JP_Sales),
sum(games$Other_Sales))
)
# Visualization 5
plot_ly(sales_df, labels = ~Region, values = ~n) %>%
add_pie(hole = 0.6) %>%
layout(title = "Global Video Game Sales by Region",
annotations = list(text = paste0("Total Global Sales: <br>",
scales::comma(round(sum(sales_df$n)))),
x = 0.5,
y = 0.5,
"showarrow" = F))
These visualizations show that video game genres and sales are not evenly distributed across genres, platforms, or regions. For example, Action is the most common genre overall, however, the most common genre can vary significantly between systems when looking at individual platforms. Overall, these findings show how both platform and region can play an important role in the distribution and sales of video games.