R_for_sports_data

Repository of sports-related resources and links for R.

View project on GitHub

R for sports data πŸ€

Overview πŸ’¬

This is a very broad introduction to R and R Studio for data analysis and visualisation in sports. A small set of slides can be found in this repository to get you started. There is also some example code to step you through some basics, then some more code to show some sport specific examples using R and RStudio for NBA data. This is intended to jump-start your journey into this vast area which forms an intersection of data science, sport science, statistics, design, and many other disciplines.

I have collected a few resources that have helped me along the way (so far), and thought it would be useful to keep them all in one place. I’m sure that there are many more amazing sports-related resources out there, so if you think they would fit in here, feel free to contribute.

Enjoy the process and try to get involved in the wider R community (e.g., #rstats, #tidytuesday, etc.)!


Data from specific sports or leagues 🏟️

AFL & AFLW Data

πŸ”— Β  https://github.com/jimmyday12/fitzRoy

ATP Tennis Rankings, Results, and Stats

πŸ”— Β  https://github.com/JeffSackmann/tennis_atp

Baseball Data

πŸ”— Β  https://github.com/BillPetti/baseballr

Cricket Data

πŸ”— Β  https://github.com/tvganesh/cricketr

ESPN (NFL/College Football) Data

πŸ”— Β  https://github.com/jthomasmock/espnscrapeR/

NBA (Basketball) Data

πŸ”— Β  https://github.com/abresler/nbastatR

NCAA College Basketball Data

πŸ”— Β  https://github.com/meysubb/collegeballR

NFL (American Football) play-by-play Data

πŸ”— Β  https://github.com/mrcaseb/nflfastR

NHL (Ice Hockey) Data

πŸ”— Β  https://github.com/jamesmartherus/nhldata

NWSL (US Women’s Soccer) Data

πŸ”— Β  https://github.com/adror1/nwslR

Soccer/Football Data

πŸ”— Β  https://github.com/jalapic/engsoccerdata

Suncorp Super Netball (SSN) Data

πŸ”— Β  https://github.com/SteveLane/superNetballR

Tennis Data

πŸ”— Β  https://github.com/skoval/deuce

WTA Tennis Rankings, Results, and Stats

πŸ”— Β  https://github.com/JeffSackmann/tennis_wta


Twitter accounts to follow

A few quick points:

  1. This is not an exhaustive list, just some accounts that come to mind;
  2. They are in absolutely no particular order;
  3. Many of these people could easily fit in multiple categories

R & Sport

@dataandme @StatsbyLopez @MeghanMHall @alicesweeting @mitch_mooney @heidithornton09 @alittlefitness @benbbaldwin @jacquietran @mitchhendo @nnstats @StatsOnTheT

Data Viz in R

@thomas_mock @CedScherer @thomasp85 @ClausWilke @drob @OSPpatrick @ellis_hughes @R4DScommunity

Everything R

@hadleywickham @apreshill @JennyBryan @robinson_es @nj_tierney @mdneuzerling

Statistics

@dsquintana @lakens @ChelseaParlett @MT_statistics @MatterOfStats


Extra Resources πŸ“š

πŸ“‘ Β  RStudio Education by @RStudioEDU

πŸ“‘ Β  R for Data Science by @hadleywickham & @StatGarrett

πŸ“‘ Β  Fundamentals of Data Visualization by @ClausWilke

πŸ“‘ Β  FiveThirtyEight - Sports Data Analysis by @FiveThirtyEight

πŸ“‘ Β  Hockey Analytics Night In Canada by @MeghanChayka & @AlisonL

πŸ“‘ Β  From Data to Viz - Selecting the most appropriate viz for your data by @R_Graph_Gallery

πŸ“‘ Β  A ggplot2 tutorial for beautiful plotting in R by @CedScherer

πŸ“Ή Β  ISBS Lecture Series - Statistics in Sports Science by @KristinSainani

πŸ“Ή Β  Intro to nflscrapR in the Tidyverse by @thomas_mock

πŸ“Ή Β  Basics of R & Tidyverse - Youtube Channel by @KellyBodwin

πŸ“Ή Β  Plotting anything with ggplot2 by @thomasp85

πŸ“Ή Β  Tidy X Screencasts - Youtube Channel by @OSPpatrick & @ellis_hughes

πŸ“Ή Β  R & Tidy Tuesday Screencasts - Youtube Channel by @drob

πŸ“Ή Β  R Consortium - Youtube Channel by @RConsortium

πŸ“ Β  Wickham et al., (2019). Welcome to the Tidyverse. Journal of Open Source Software, 4(43), 1686. https://doi.org/10.21105/joss.01686

πŸ“ Β  Hadley Wickham, (2014). Tidy Data. Journal of Statistical Software, 59(10). http://dx.doi.org/10.18637/jss.v059.i10


Contact me (Edward Brooks) on Twitter or Email

🏈 Β  Β  πŸ€ Β  Β  ⚽ Β  Β  ⚾ Β  Β  🎾 Β  Β  🎱 Β  Β  πŸ‰ Β  Β  🎳 Β  Β  β›³ Β  Β  πŸƒ Β  Β  🚴 Β  Β  πŸ‚ Β  Β  🏊 Β  Β  🏈 Β  Β  πŸ€ Β  Β  ⚽ Β  Β  ⚾ Β  Β 

license contributions welcome