Footballers are younger than you

r
shiny
soccer
Author
Published

July 17, 2018

tl;dr

I wrote an R Shiny app that tells you how many players at World Cup 2018 were younger than you. It’s designed to make you feel old. You’re welcome.

The World Cup Final

So the World Cup is over for another year.

I managed luckily to get tickets for the final, where Karpatlya—a Hungarian diaspora in Ukraine—overcame the powerful Northern Cyprus team on penalties at the Queen Elizabeth Stadium in Enfield, North London.

Another successful tournament from the Confederation of Independent Football Associations (CONIFA).

Two tickets to the CONIFA World Cup final.

Extremely rare and valuable tickets for the (CONIFA) World Cup final.

It didn’t come home

Oh and also the far-less popular FIFA World Cup has also finished.

Wonderkid Kylian Mbappé picked up the young player of the tournament as France lifted the trophy for the second time in their history.

Yes, 19-year-old Mbappé is young enough to have been born after France’s last World Cup win in 1998. That makes me feel old.

It seems only yesterday that I was dreaming of starting alongside hall-of-famer Bermudan Shaun Goater in the extremely successful Manchester City squad at the turn of the millennium.1 (That reference probably dates me quite well.)

Obviously I can still make it as an elite footballer. Right? What better way to find out than to build an app with R Shiny.

The app

You can clone the GitHub repo and run the app,2 or from an active R session you can run the following to download and run it:

shiny::runGitHub("wc18-age", "matt-dray")

The app depends on the packages {shiny}, {shinythemes} and {DT}. I used the data set in the AllezCannes/WorldCupSquads GitHub repo, which contains player data scraped from Wikipedia by user philstraforelli.

The app asks merely for your birth date—selectable from the dropdown menu—and calculates the number and percentage of players younger than you, with an interactive table that lists who they are.

A preview of the app, showing date of birth input, some text with calculation of your age and a table with the footballers who were younger than you.

A colleague suggested that wasn’t enough punishment. So I updated it to tell you how many of the players you could be parent to (assuming you had them when you were age 18).

Here’s some solid reviews I’ve received so far:

Very depressing

I knew I was too old to become a great footballer

Just what I needed to see

Enjoy! And take inspiration from Kazuyoshi ‘King Kazu’ Miura, a Japanese 51-year-old (born 1967) who is still playing at time of writing. He’s apparently just played a match for Yokohama FC alongside 16-year-old Koki Saito (born 2001), who in theory is young enough to be his grandson!

Note

I re-rendered this post in 2023 and King Kazu is still playing aged 56! He’s at a Portuguese club with another player called Kazu, who was born in 2000. King Kazu had 14 years and 11 clubs under his belt when young Kazu was born.

Environment

Session info
Last rendered: 2023-08-08 22:36:26 BST
R version 4.3.1 (2023-06-16)
Platform: aarch64-apple-darwin20 (64-bit)
Running under: macOS Ventura 13.2.1

Matrix products: default
BLAS:   /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/lib/libRblas.0.dylib 
LAPACK: /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/lib/libRlapack.dylib;  LAPACK version 3.11.0

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

time zone: Europe/London
tzcode source: internal

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
 [1] htmlwidgets_1.6.2 compiler_4.3.1    fastmap_1.1.1     cli_3.6.1        
 [5] tools_4.3.1       htmltools_0.5.5   rstudioapi_0.15.0 yaml_2.3.7       
 [9] rmarkdown_2.23    knitr_1.43.1      jsonlite_1.8.7    xfun_0.39        
[13] digest_0.6.33     rlang_1.1.1       fontawesome_0.5.1 evaluate_0.21    

Footnotes

  1. Season 2000/2001: 18th place and relegation to Division 1. After having climbed from Division 2 to the Prem in the preceding two seasons, lol. Who said being a Man City fan was boring?↩︎

  2. It was hosted originally on shinyapps.io, but I took it down to make room for another app.↩︎

Reuse

CC BY-NC-SA 4.0