library(tidyverse)
## -- Attaching packages ------------------------------------------------ tidyverse 1.3.0 --
## v ggplot2 3.3.1     v purrr   0.3.4
## v tibble  3.0.0     v dplyr   1.0.0
## v tidyr   1.1.0     v stringr 1.4.0
## v readr   1.3.1     v forcats 0.5.0
## -- Conflicts --------------------------------------------------- tidyverse_conflicts() --
## x dplyr::filter() masks stats::filter()
## x dplyr::lag()    masks stats::lag()
player <- read.csv(file.choose(), header = T)

Data contains six plyer, i.e., Messi, Cristiano, Zlatan, Suarez, Rooney, & Aguero

  1. COmparing all of six
compare.six <- ggplot(player, aes(Season, GLS)) +
     geom_point(aes(col = Player)) +
     geom_line(aes(group = Player, color = Player), size = 1) +
     scale_x_discrete(guide = guide_axis(n.dodge = 2)) +
    theme(axis.text = element_text(size = 18), 
          axis.title = element_text(size = 18),
          legend.text = element_text(size = 18),
          legend.title = element_text(size = 18)) +
    labs(title="Performance Comparation among Best Football Strikers", 
         caption="data compiled from = fbref.com",
         x="Season",
         y="Goal per Season") +
      theme_bw()
print(compare.six)

  1. Comparing Messi, Cristiano, Aguero
  compare.three <- player %>%
    filter(Player %in% c("Messi", "Cristiano", "Aguero")) %>%
  ggplot(aes(Season, GLS)) +
    geom_point(aes(col = Player)) +
    geom_line(aes(group = Player, color = Player), size = 1) +
    scale_x_discrete(guide = guide_axis(n.dodge = 2)) +
    theme(axis.text = element_text(size = 18), 
          axis.title = element_text(size = 18),
          legend.text = element_text(size = 18),
          legend.title = element_text(size = 18)) +
    labs(title="Performance Comparation among Best Football Strikers", 
         caption="data compiled from = fbref.com",
         x="Season",
         y="Goal per Season") +
    theme_bw()
print(compare.three)

  1. Best goal rate per match between Messi, Cristiano, Aguero
permatch <- player %>%
    filter(Player %in% c("Messi", "Cristiano", "Aguero")) %>%
    ggplot(aes(Season, gls90)) +
    geom_point(aes(col = Player)) +
    geom_line(aes(group = Player, color = Player), size = 1) +
    scale_x_discrete(guide = guide_axis(n.dodge = 2)) +
    theme(axis.text = element_text(size = 18), 
          axis.title = element_text(size = 18),
          legend.text = element_text(size = 18),
          legend.title = element_text(size = 18)) +
    labs(title="Performance Comparation among Best Football Strikers", 
         caption="data compiled from = fbref.com",
         x="Season",
         y="Goal per 90 mins") +
    theme_bw()
print(permatch)

  1. Goal Per Match All
permatchall <- ggplot(player, aes(Season, gls90)) +
    geom_point(aes(col = Player)) +
    geom_line(aes(group = Player, color = Player), size = 1) +
    scale_x_discrete(guide = guide_axis(n.dodge = 2)) +
    theme(axis.text = element_text(size = 18), 
          axis.title = element_text(size = 18),
          legend.text = element_text(size = 18),
          legend.title = element_text(size = 18)) +
    labs(title="Performance Comparation among Best Football Strikers", 
         caption="data compiled from = fbref.com",
         x="Season",
         y="Goal from penalty") +
    theme_bw()
print(permatchall)

  1. Who scores from penalty most frequently
  penalty <- ggplot(player, aes(Season, PK)) +
    geom_col(aes (fill = Player)) +
    scale_x_discrete(guide = guide_axis(n.dodge = 2)) +
    theme(axis.text = element_text(size = 18), 
          axis.title = element_text(size = 18),
          legend.text = element_text(size = 18),
          legend.title = element_text(size = 18)) +
    labs(title="Performance Comparation among Best Football Strikers", 
         caption="data compiled from = fbref.com",
         x="Season",
         y="Goal from penalty") +
    theme_bw()
print(penalty)

  1. Assist comparation Customizing theme
  assist <- ggplot(player, aes(Season, AST)) +
    geom_col(aes (fill = Player)) +
    scale_x_discrete(guide = guide_axis(n.dodge = 2)) +
    theme(axis.text = element_text(size = 14), 
          axis.title = element_text(size = 14),
          axis.text.x = element_text (size = 10),
          legend.text = element_text(size = 12),
          legend.title = element_text(size = 12),
          panel.grid = element_blank(),
          panel.background = element_blank(),
          axis.line = element_line(color = "grey"))+
    labs(title="Performance Comparation among Best Football Strikers", 
         caption="data compiled from = fbref.com",
         x="Season",
         y="Assist") 
  print(assist)