knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-" )
The eurolig package provides a set of tools to obtain and analyze basketball generated data from the Euroleague.
API wrapper around the official website of the Euroleague.
Functions to obtain stats, play-by-play data and shot location data in a tidy format within R.
Tools to analyze and visualize the data.
# install.packages("devtools") devtools::install_github("solmos/eurolig")
Let's say we want to analyze play-by-play data from the Championship game of the 2017-2018 season between Real Madrid and Fenerbache Dogus Istanbul. We can obtain the data by entering the game code and the season to the function extractPbp()
. The game code for the game can be found in the game's URL.
library(eurolig) pbp <- extractPbp(game_code = 260, season = 2017) pbp
From these data we can extract information about the assists in that game from, say, Real Madrid (MAD):
assists <- getAssists(pbp, team = "MAD") assists
Shot location data can also be retrieved and visualized:
shots <- extractShots(260, 2017) plotShotchart(shots)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.