Saturday 29 January 2022

Six Nation 2021 Visualisation of was on the pitch when the teams scored - Introduction

Partly in follow up to some ideas from my 2019 Rugby Union data visualisations and partly in advance of next year's StatsCup, because I have grand plans, I wanted to find a way of mapping players on a team that play together as a unit. 

This is somewhat complicated by my complete lack of coding. 

More recently, I read this marvellous post by Jim Vallandingham.  I really like this post because it gives code and a link to his data so I can figure out the format my data needs to be in in order to replicate the analysis. If more people could do that, I'd be grateful. 

If you read the post, you'll see it contains a way of looking at actors who co-occur. And I thought, ding, ding, I can warp and spindle this to fulfill my aims. 

I have chosen to look at which players appear together when their team score a try and the time of the tries to see if I can spot any patterns. 

The data sources used are: 
The Guardian As It Happened reports - https://www.theguardian.com/sport/six-nations-2021 Wikipedia's 6 Nations 2021 article - https://en.wikipedia.org/wiki/2021_Six_Nations_Championship 

I've had to use both because it turns out that the Guardian As It Happened reports don't always cover substitutions, and I've used the Wikipedia page to fill in the gaps. Occasionally, they disagree as to the exact minute of substitutions and points scored. 

You might have noticed this is being posted quite close to the start of this year's Six Nations, and if you've guessed that's because I forgot the start date for the 2022 Six Nations, you'd be right. I thought it began at the start of March and I planned to post these posts in the two weeks that lead up to the start date. The plan has undergone a sudden change :)

The plan is to present the information for each team  (in alphabetical order to avoid argument), and then a post comparing the different teams. 

I will be trying to upload the code and the json files onto github because I'm sure other people will do even more fun things with the data, but the word "trying" is the important one in that sentence. 

I need to thank @jenineharris, @z_4_ch and @robchristley for answering my questions on Twitter when I was struggling. 

The first things I learnt doing this are: 
1- I need to update R and RStudio more regularly than once a year 
2 - library (package = "name") is my friend 
3 - capital letters are important in R 
4 - how to set up a Github repository.

England - https://fulltimesportsfan.blogspot.com/2022/01/6-nations-2021-data-visualisation.html

No comments:

Post a Comment