CRAN Task View: Sports Analytics

Maintainer:Benjamin S. Baumer, Quang Nguyen, Gregory J. Matthews
Contact:ben.baumer at gmail.com
Version:2022-06-15
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 (2022). CRAN Task View: Sports Analytics. Version 2022-06-15. 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.

General

Sport-Specific Packages

American Football 🏈

Association Football (Soccer) ⚽

Australian Rules Football 🏉

Baseball ⚾

Basketball 🏀

Chess ♟

Cricket 🏏

Esports 🎮

GPS Tracking 📍

Hockey 🏒

Racket Sports 🎾🏓🏸

Softball 🥎

Swimming 🏊

Track and Field 🏃

Volleyball 🏐

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, pitchRx.
Regular:AdvancedBasketballStats, baseballDBR, BasketballAnalyzeR, bigchess, BSBT, BTdecayLasso, cfbfastR, chess, chessR, colorr, combinedevents, cricketdata, cricketr, elo, EloChoice, EloOptimized, EloRating, engsoccerdata, EUfootball, fastRhockey, fastrmodels, fflr, ffscrapr, ffsimulator, fitzRoy, footballpenaltiesBL, footBayes, FPLdata, ggsoccer, gsisdecoder, hoopR, howzatR, implied, itscalledsoccer, JumpeR, mlbstats, mvglmmRank, NBAloveR, nbapalettes, nfl4th, nflfastR, nflplotR, nflreadr, nflseedR, NFLSimulatoR, nhlapi, NHLData, nhlscrape, odds.converter, pinnacle.data, piratings, PlayerRatings, qqr, rchess, RDota2, retrosheet, RKelly, rStrava, runexp, socceR, SportsTour, sportyR, squashinformr, stockfish, SwimmeR, teamcolors, toRvik, TouRnament, trackeR, trackeRapp, uncmbb, volleystat, wehoop, welo, worldfootballR, yorkr.

Related links

Other resources