shotclock | R Documentation |
Computes, for each action, an estimate of the value of the shotclock when the action has ended
shotclock(
PbP_data,
team_data,
sec_14_after_oreb = FALSE,
report = FALSE,
verbose = FALSE,
seconds_added_after_made_shot = 2,
max_error_threshold = 4
)
PbP_data |
a play-by-play dataframe, previously handled by the function PbPmanipulation |
team_data |
dataframe, contains several data regarding the teams in the NBA. Inside this function it is used only to check if |
sec_14_after_oreb |
boolean, it indicates if the shotclock has been set to 14 seconds in certain situations. It has to be true if the data have been recorded after the 2018-19 season. The default value is |
report |
boolean, if TRUE, the function prints a few details about some data which have a negative value of shotclock (and therefore have been correceted) |
verbose |
boolean, if TRUE, adds some comments about the computations |
seconds_added_after_made_shot |
numeric value, after a shot is made the period clock is not stopped (unless it is in the last minutes of each quarter), hence a certain number of seconds has to be added in order to take account of the seconds taken for the inbound pass |
max_error_threshold |
numeric value, some errors still occur in the data and some negative values of shotclock are produced (in general due to some delay between the end of the action and its registration). This parameters indicates the maximum absolute value of negative shotclock which is arbitrarily fixed to a positive value; the values of shotclock below this threshold are set as NAs |
It is necessary that the name of the team is contained in the column corresponding to the description
The play-by-play data, with the additional data regarding the value of shotclock and the boolean indicating whether the action has started with a value of shotclock equal to 14 seconds
Andrea Fox
P. Zuccolotto and M. Manisera (2020) Basketball Data Science: With Applications in R. CRC Press.
P. Zuccolotto, M. Manisera and M. Sandri (2018) Big data analytics for modeling scoring probability in basketball: The effect of shooting under high pressure conditions. International Journal of Sports Science & Coaching.
PbP <- PbPmanipulation(PbP.BDB)
PbP <- shotclock(PbP_data = PbP, team_data = Tadd)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.