CRAN Task View: Sports Analytics

Maintainer:Benjamin S. Baumer, Quang Nguyen, Gregory J. Matthews
Contact:ben.baumer at gmail.com
Version:2024-09-19
URL:https://CRAN.R-project.org/view=SportsAnalytics
Source:https://github.com/cran-task-views/SportsAnalytics/
Contributions:Suggestions and improvements for this task view are very welcome and can be made through issues or pull requests on GitHub or via e-mail to the maintainer address. For further details see the Contributing guide.
Citation:Benjamin S. Baumer, Quang Nguyen, Gregory J. Matthews (2024). CRAN Task View: Sports Analytics. Version 2024-09-19. URL https://CRAN.R-project.org/view=SportsAnalytics.
Installation:The packages from this task view can be installed automatically using the ctv package. For example, ctv::install.views("SportsAnalytics", coreOnly = TRUE) installs all the core packages or ctv::update.views("SportsAnalytics") installs all packages that are not yet installed and up-to-date. See the CRAN Task View Initiative for more details.

This CRAN Task View contains a list of packages useful for sports analytics. Most of the packages are sport-specific and are grouped as such. However, we also include a General section for packages that provide ancillary functionality relevant to sports analytics (e.g., team-themed color palettes), and a Modeling section for packages useful for statistical modeling. Throughout the task view, and collected in the Related links section at the end, we have included a list of selected books and articles that use some of these packages in substantive ways. Our goal in compiling this list is to help researchers find the tools they need to complete their work in R.

To be considered for inclusion, the package must be useful for conducting sports analytics. Most packages provide functionality for some combination of:

  1. acquiring data for a specific sport or league
  2. performing common computations on sport-specific data

Esports and sports betting packages are within scope.

The list of packages is aspirationally comprehensive. If there is a sports analytics package on CRAN that we have missed, please let us know. Contributions are always welcome, and encouraged – please see the linked GitHub repository for details.

Sport-Specific Packages

American Football 🏈

Association Football (Soccer) ⚽

Australian Rules Football 🏉

Baseball ⚾

Basketball 🏀

Chess ♟

Cricket 🏏

Esports 🎮

Formula 1 🏎️

GPS Tracking 📍

Hockey 🏒

Softball 🥎

Swimming 🏊

Track and Field 🏃

Volleyball 🏐

General

Modeling

A wide array of functions for modeling in sports analytics are available in the R base package (e.g. lm() and glm()). In addition, other CRAN Task Views such as Bayesian, MachineLearning, Robust, Spatial, and SpatioTemporal may contain appropriate packages for applying statistical methods to sports.

Betting

Ratings

CRAN packages

Core:baseballr, BAwiR, BradleyTerry2, Lahman, nflverse.
Regular:AdvancedBasketballStats, BasketballAnalyzeR, bigchess, bundesligR, chess, ChessGmooG, colorr, combinedevents, cricketdata, cricketr, CSGo, elo, EloChoice, EloOptimized, EloRating, EUfootball, euroleaguer, f1dataR, fastRhockey, fastrmodels, ffscrapr, fitzRoy, footballpenaltiesBL, footBayes, FPLdata, gameR, ggsoccer, gsisdecoder, hoopR, howzatR, implied, injurytools, ISAR, itscalledsoccer, mlbplotR, mlbstats, mvglmmRank, NBAloveR, nbapalettes, nblR, nfl4th, nflfastR, nflplotR, nflreadr, nflseedR, NFLSimulatoR, nhlapi, NHLData, odds.converter, oddsapiR, opendotaR, pinnacle.data, piratings, PlayerRatings, rbedrock, RDota2, retrosheet, RKelly, ROpenDota, rStrava, runexp, sleeperapi, socceR, SportsTour, sportyR, SwimmeR, teamcolors, trackeR, trackeRapp, uncmbb, volleystat, wehoop, welo, worldfootballR, yorkr.

Related links

Other resources