Introduction

Football has become one of the most data-driven sports in the world. Clubs, analysts, and scouts rely on performance data to evaluate players, identify talent, and make informed decisions. This report analyzes the FIFA Legacy Players dataset to explore relationships between player performance, age, market value, wages, nationalities, clubs, and playing positions.

The objective of this project is to demonstrate how data visualization can reveal meaningful patterns within professional football data using a variety of graphical techniques.

Figure 1: Age vs Overall Rating

ggplot(dat, aes(x = age, y = overall)) +
  geom_point(alpha = 0.3, color = "steelblue") +
  labs(
    title = "Figure 1: Relationship Between Age and Overall Rating",
    x = "Age",
    y = "Overall Rating"
  ) +
  theme_minimal()

The scatter plot shows the relationship between player age and overall rating. Most highly rated players fall between the ages of 24 and 31, suggesting that players often reach their peak performance during these years. Younger players display greater variation because many are still developing their abilities.

Figure 2: Potential vs Overall

ggplot(dat, aes(x = potential, y = overall)) +
  geom_point(alpha = 0.3, color = "darkgreen") +
  labs(
    title = "Figure 2: Potential Rating vs Overall Rating",
    x = "Potential",
    y = "Overall Rating"
  ) +
  theme_minimal()

This visualization demonstrates a strong positive relationship between a player’s current overall rating and potential rating. Players with higher potential generally have higher current ratings, while younger players often show higher potential relative to their current performance.

Figure 3: Top Nationalities

top_nations <- dat %>%
  count(nationality_name, sort = TRUE) %>%
  slice_head(n = 15)

ggplot(top_nations,
       aes(x = reorder(nationality_name, n), y = n)) +
  geom_col(fill = "darkorange") +
  coord_flip() +
  labs(
    title = "Figure 3: Top 15 Nationalities in the Dataset",
    x = "Nationality",
    y = "Number of Players"
  ) +
  theme_minimal()

The bar chart highlights the countries with the greatest number of players represented in the dataset. Nations with strong football traditions contribute the largest share of professional players, reflecting the depth of their domestic football systems.

Figure 4: Top Clubs

top_clubs <- dat %>%
  count(club_name, sort = TRUE) %>%
  slice_head(n = 15)

ggplot(top_clubs,
       aes(x = reorder(club_name, n), y = n)) +
  geom_col(fill = "purple") +
  coord_flip() +
  labs(
    title = "Figure 4: Clubs with the Largest Number of Players",
    x = "Club",
    y = "Players"
  ) +
  theme_minimal()

This visualization compares the number of players associated with each club in the dataset. Some clubs have substantially larger player pools represented, reflecting differences in squad size, youth development, and dataset coverage.

Figure 5: Overall Rating by Playing Position

position_data <- dat %>%
  filter(!is.na(player_positions)) %>%
  mutate(main_position = sub(",.*", "", player_positions))

ggplot(position_data,
       aes(x = main_position, y = overall)) +
  geom_boxplot(fill = "skyblue") +
  labs(
    title = "Figure 5: Overall Rating by Playing Position",
    x = "Playing Position",
    y = "Overall Rating"
  ) +
  theme_minimal() +
  theme(axis.text.x = element_text(angle = 45, hjust = 1))

This box plot compares the distribution of overall player ratings across different playing positions. While ratings vary within every position, some positions show higher median ratings than others, demonstrating differences in player roles and performance levels.

Figure 6: Distribution of Player Ages

ggplot(dat, aes(x = age)) +
  geom_histogram(binwidth = 1,
                 fill = "steelblue",
                 color = "white") +
  labs(
    title = "Figure 6: Distribution of Player Ages",
    x = "Age",
    y = "Number of Players"
  ) +
  theme_minimal()

The histogram shows that most professional football players are between 20 and 30 years old. Very young and older players appear less frequently, reflecting the typical age range of professional football careers.

Figure 7: Correlation Between Player Attributes

numeric_data <- dat %>%
  select(age,
         overall,
         potential,
         value_eur,
         wage_eur,
         height_cm,
         weight_kg)

cor_matrix <- cor(numeric_data,
                  use = "complete.obs")

corrplot(cor_matrix,
         method = "color",
         type = "upper",
         tl.col = "black",
         tl.srt = 45)

The heatmap highlights relationships among key numerical variables. Overall rating and potential show a strong positive correlation, while market value and wages are also closely associated with player quality.

Figure 8: Market Value vs Weekly Wage (Interactive)

interactive_plot <-
  ggplot(dat,
         aes(x = wage_eur,
             y = value_eur,
             text = short_name)) +
  geom_point(color = "red",
             alpha = 0.4) +
  labs(
    title = "Figure 8: Market Value vs Weekly Wage",
    x = "Weekly Wage (EUR)",
    y = "Market Value (EUR)"
  ) +
  theme_minimal()

ggplotly(interactive_plot,
          tooltip = "text")

The interactive scatter plot allows users to explore the relationship between player wages and market values by hovering over individual points. In general, players with higher market values also tend to earn higher wages, although some players deviate from this trend.

Conclusion

This project explored professional football player data using the FIFA Legacy dataset. Through eight different visualizations, several important patterns were identified regarding player age, overall ratings, potential, market value, wages, clubs, nationalities, and playing positions.

The analysis demonstrated that data visualization is an effective way to summarize large datasets and reveal relationships that may not be immediately apparent in raw data. The combination of scatter plots, bar charts, box plots, histograms, a correlation heatmap, and an interactive visualization provides a comprehensive overview of professional football player characteristics and supports data-driven decision-making in sports analytics.