View source: R/PbPmanipulation.R
PbPmanipulation | R Documentation |
Adapts the standard file supplied by BigDataBall to the format required by BasketballAnalyzeR
PbPmanipulation(data, period.length = 12, overtime.length = 5)
data |
a play-by-play data frame supplied by BigDataBall. |
period.length |
numeric, the length of a quarter in minutes (default: 12 minutes as in NBA) |
overtime.length |
numeric, the length of an overtime period in minutes (default: 5 minutes as in NBA) |
A play-by-play data frame.
The data frame generated by PbPmanipulation
has the same variables of PbP.BDB
(when necessary, coerced from one data type to another, e.g from factor to numeric) plus the following five additional variables:
periodTime
, time played in the quarter (in seconds)
totalTime
, time played in the match (in seconds)
playlength
, time since the immediately preceding event (in seconds)
ShotType
, type of shot (FT, 2P, 3P)
oppTeam
, name of the opponent team
hometeam
, name of the home team (generated conditionally on the presence of the variable home_score
)
Marco Sandri, Paola Zuccolotto, Marica Manisera (basketballanalyzer.help@unibs.it)
P. Zuccolotto and M. Manisera (2020) Basketball Data Science: With Applications in R. CRC Press.
PbP.BDB
PbP <- PbPmanipulation(PbP.BDB)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.