/R_for_sports_data

Repository of sports-related resources and links for R.

Primary LanguageHTMLMIT LicenseMIT

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