CRAN Task View: Sports Analytics

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

GPS Tracking 📍

Hockey 🏒

Softball 🥎

Swimming 🏊

Track and Field 🏃

Volleyball 🏐



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.



CRAN packages

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

Related links

Other resources