Skip to main content

Posts

Shot Maps In R using StatsBomb Data

Im not sure if anyone is following these, but I will do one more and see what happens! I have covered some passing based stuff, I thought it might be useful to look into shots. Therefore, the rough plan for this piece: 1) Total player xG in the WSL for this season 2) Find the top 9 players based on xG 3) Plot all shots taken including xG 4) Add labels 5) Plot the shot map of the 9 players against one another As always, my coding is in the learning stage so this isn't a definitive way...just something that works for me and might help others! Anyway, load in this seasons WSL data as we have previously. We want to extract 3 things from the data - the number of shots, numbers of goals and total xG (initially including penalties) To start - tallying player shots: player_shots<-StatsBombData%>%   filter(type.name == "Shot")%>% ##filter all shots in StatsBombData   group_by(player.name)%>% ##group by player   tally(name = "total_shots"...

Using StatsBomb data - part 3

I have more time on my hands so thought it would be good fun to show some steps from creating creating scatters to plotting event data to show those that show up favourably in initial searches. The question that I posed myself was: "How can we go beyond scatters to learn more about a players output?" There has been an increase in scatter plots to show players that excel, however they don't tell the whole story. As always, I'm still learning code myself so I'm sure there is code in here that will upset experienced coders! Sorry! Anyway, a rough idea of how this will look - - download data from fbref.com - plot a scatter using the data - filter the top 9 performers for one parameter - plot the event data - compare the player outputs Lets goooooooooooo Lets fire up: library(StatsBombR) library(tidyverse) library(ggsoccer) library(ggrepel) We could create the P90 data for the WSL ourselves by using the StatsBomb data, however I'm being l...

Using R and StatsBomb Data - Part 2

Following my first tutorial loading R and importing StatsBomb data to plot passes in a specific FAWSL match I've had loads of good feedback! ( Tutorial One ) There seems to be a general appetite for a second part how the plots can be progressed and further information added - so lets give it a go! As always, I will caveat that I'm no expert in R and have been self teaching since Christmas 2019 - as such I'm presenting something that works for me but may not be the *entirely* correct way of doing things! Anyway,  below was the final pass plot we ended up with after the first tutorial. Great that we've plotted the passes, but what can we learn from it? What could a practical application be if we wanted coaches/scouts to take away insight? Looking at below, for me, the plot infers a high density of passes on the right wing in the final third with regular crosses (in this specific match!) along side regular passing actions in the Left Centre Back location. This is...

Getting started in R with StatsBomb Data

As always, I should caveat that I'm not an expert either in football or programming...I started learning R in December and have gradually reached a 'mildly competent' level. This will go through installing R, loading the StatsBomb data, then plotting a pass map - something like this: Anyway, away we go. Thing number 1 - install R. There are two things to load...the R 'base' and Rstudio. You can download Rstudio here: https://rstudio.com/products/rstudio/download/ The first 3 minutes of the below shows the process: https://www.youtube.com/watch?v=BuaTLZyg0xs&list=PL6cDc8Xxld162nSsZ14bQnFn1cYStsrtk&index=2&t=0s That is now hopefully R loaded. Open Rstudio and you should be greeted with something like this: Press the arrow areas to reveal: Under the 'Packages' tab select 'install' and search 'devtools'..install package. Repeat the previous step however search 'tidyverse'. Next steps are to load in th...

Searching for a Right Back - Part 2

Since first writing about Oxford's search for Right Back in January I've had a feeling that whilst the steps are logical, they could probably be better. Ram Srinivas outlined a famework on the Purefitbaw podcast  that led to me creating the first piece, but also thinking how it could be improved. I started researching further and found this piece  - it relates to NBA but why not adapt and see if this can be applied to football also? On first reading, I didn't have a clue what was going on so attempted to break down each element and see if this had a logical, football implication. This lead me to Will Gurpinar-Morgan's 2+2=11  blog and initially presented a process at Opta in  2015  and further presented this year. (You should follow his work and watch his presentations!) This could provide a blueprint within recruitment when sourcing players of a specific skillset to fulfil a specific role within the squad. In Oxford's example Chris Cadden was a cre...