Chapter 23 Tournament Levels

matches %>%
  filter(!is.na(tourney_level)) %>%
  group_by(tourney_level) %>%
  summarise(Count = n()) %>%
  arrange(desc(Count)) %>%
  ungroup() %>%
  mutate(tourney_level = reorder(tourney_level,Count)) %>%
  
 
  ggplot(aes(x = tourney_level,y = Count)) +
  geom_bar(stat='identity',colour="white",fill=fillColor2) +
  geom_text(aes(x = tourney_level, y = 1, label = paste0("(",Count,")",sep="")),
            hjust=0, vjust=.5, size = 4, colour = 'black',
            fontface = 'bold') +
  labs(x = 'Tournament Levels', 
       y = 'Count', 
       title = 'Tournament Levels and Count') +
  coord_flip() + 
  theme_bw()

tournamnentLevelTournaments = function(tournamnentLevel)
{
  matches %>%
  filter(tourney_level == tournamnentLevel) %>%
  group_by(tourney_name) %>%
  summarise(Count = n()) %>%
  arrange(desc(Count)) %>%
  ungroup() %>%
  mutate(tourney_name = reorder(tourney_name,Count)) %>%
  head(10) %>%
 
  ggplot(aes(x = tourney_name,y = Count)) +
  geom_bar(stat='identity',colour="white",fill=fillColor) +
  geom_text(aes(x = tourney_name, y = 1, label = paste0("(",Count,")",sep="")),
            hjust=0, vjust=.5, size = 4, colour = 'black',
            fontface = 'bold') +
  labs(x = 'Tournament Name', 
       y = 'Count', 
       title = 'Tournament Name and Count') +
  coord_flip() + 
  theme_bw()
  
}

tournamnentLevelWinners = function(tournamnentLevel)
{
  matches %>%
  filter(tourney_level == tournamnentLevel) %>%
  group_by(winner_name) %>%
  summarise(Count = n()) %>%
  arrange(desc(Count)) %>%
  ungroup() %>%
  mutate(winner_name = reorder(winner_name,Count)) %>%
  head(10) %>%
 
  ggplot(aes(x = winner_name,y = Count)) +
  geom_bar(stat='identity',colour="white",fill=fillColor2) +
  geom_text(aes(x = winner_name, y = 1, label = paste0("(",Count,")",sep="")),
            hjust=0, vjust=.5, size = 4, colour = 'black',
            fontface = 'bold') +
  labs(x = 'Winner', 
       y = 'Count', 
       title = 'Winner and Count') +
  coord_flip() + 
  theme_bw()
  
}

We investigate the Top Winners in the different Tournament Levels

  • Williams sisters and Maria Sharapova occupy the Top Three spots in Grand Slams

  • Elena Dementieva , Justin Henin and Martina Hingis occupy the Top Three spots in T1 tournaments. The T1 tournaments with the most matches are Miami, Indian Wells and Rome

  • Amelie Mauresmo , Lindsay Davenport and Kim Clijsters occupy the Top Three spots in T2 tournaments.The T2 tournaments with the most matches are Amelia Island, Los Angeles and Sydney

23.1 Most Wins in Grand Slams

tournamnentLevelWinners('G')

23.2 Most matches in Premier Tournament Level

tournamnentLevelTournaments('P')

23.3 Most Wins in Premier Tournament Level

tournamnentLevelWinners('P')

23.4 Most matches in I Tournament Level

tournamnentLevelTournaments('I')

23.5 Most Wins in I Tournament Level

tournamnentLevelWinners('I')

23.6 Most matches in T1 Tournament Level

tournamnentLevelTournaments('T1')

23.7 Most Wins in T1 Tournament Level

tournamnentLevelWinners('T1')

23.8 Most matches in T2 Tournament Level

tournamnentLevelTournaments('T2')

23.9 Most Wins in T2 Tournament Level

tournamnentLevelWinners('T2')

23.10 Most matches in T3 Tournament Level

tournamnentLevelTournaments('T3')

23.11 Most Wins in T3 Tournament Level

tournamnentLevelWinners('T3')