Euro 2016 Squads

[This article was first published on R – Guy Abel, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

This weekend I was having fun in France watching some Euro 2016 matches, visiting friends and avoiding Russian hooligans. Before my flight over I scraped some tables on the tournaments Wikipedia page with my newly acquired rvest skills, with the idea to build up a bilateral database of Euro 2016 squads and their players clubs.

On the flight I managed to come up with some maps showing these connections. First off I used ggplot2 to plot lines connecting the location of every players club teams to their national squads base in France. The path of the lines were calculated using the gcIntermediate function in the geosphere package. The lines colour is based on the national teams jersey, which I obtained via R using the amazing extract_colours function in the rPlotter package.plot_baseI was not entirely convinced that this plot is too effective as the base camp of each team in France is not particularly common knowledge. This led me to create a new plot with a link from the players club teams to their nations capital city.

plot_capThis shows some clear relationships, such as between the Iceland players and clubs in Scandinavia and clubs in northern England and Scotland with the Irish teams. Finally, I had a go at trying to match my old World Cup circular plot using the chordDiagram function in the circlize package.

plot_circle

I ordered the countries according to their UEFA coefficient, which is based on the performance of club teams in European competitions. Most players playing abroad are based in teams in the top leagues of England, Germany, Italy or Spain. Players based in the English leagues make up most of the squads for teams from the British Isles. There are sizable numbers of the Austrian and Swiss squads playing for clubs in the German leagues and Croatian players in Italy.

All the code for the scraping the data and producing the plots are on my Github.

 


To leave a comment for the author, please follow the link and comment on their blog: R – Guy Abel.

R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)