less than 1 minute read

With EURO 2020 underway now is a good time to assess your favoured country’s historical results in international competition.

Using data compiled by Mart Jürisoo, and taking inspiration from a recent FT graphic of the results of England and Scotland throughout history, I have developed a dashboard detailing the head-to-head for each set of footballing rivals selected.

The brief code extract below gives details of how to extract and load the data set to R.

library(rvest)
library(tidyverse)

##Download the data from Github
download.file('https://github.com/martj42/international_results/raw/master/results.csv', 
              'results.csv',
               mode="wb")
##Load data into R
international <-read.csv('results.csv', 
                          header = TRUE, 
                          encoding = "UTF-8")
                          
##Reformat date field
international$date <-as.Date(international$date)

##Remove pending games and missing data
international <-filter(international, 
                       !is.na(home_score) |!is.na(away_score))

Enjoy the dashboard and the games…and good luck!