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:
- This is not an exhaustive list, just some accounts that come to mind;
- They are in absolutely no particular order;
- 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
π Β Β π Β Β β½ Β Β βΎ Β Β πΎ Β Β π± Β Β π Β Β π³ Β Β β³ Β Β π Β Β π΄ Β Β π Β Β π Β Β π Β Β π Β Β β½ Β Β βΎ Β Β