View source: R/shotperformance.R
shotperformance | R Documentation |
Computes, for each player of a specific team, its performance measure
shotperformance(
PbP_data,
player_data,
team_data,
shotclock_interval = c(0, 24),
totaltime = 0,
score_difference = c(-100, 100),
shot_type = "field",
min_shots = 100,
min_shots_high_pressure = 10,
verbose = FALSE,
teams = "all"
)
PbP_data |
a play-by-play dataframe, previously handled by the functions PbPmanipulation, shotclock and scoredifference |
player_data |
dataframe containing the boxscore data of all players of a particula season. We need it to know the players who have played at least one match for a team during the season. This dataframe might be substituted by a dataframe which has a column |
team_data |
dataframe, contains several data regarding the teams in the NBA. Inside this function it is used only to check if |
shotclock_interval |
vector of two numeric values or single numeric value, condition on the value of shotclock of the shots that will be considered |
totaltime |
vector of two numeric values, condition on the value of score.diff of the shots that will be considered |
score_difference |
numeric value, condition on the value of totalTime of the shots that will be considered |
shot_type |
character, the type of shots to be analyzed; available options: "2P", "3P", "FT", "field" |
min_shots |
minimum value of total shots that a player must have attempted in order to qualify for the computation of the performance statistic |
min_shots_high_pressure |
minimum value of total shots that a player must have attempted in an high pressure situation in order to qualify for the computation of the performance statistic |
verbose |
boolean, if TRUE, adds some comments about the computations |
teams |
character or vector of characters, indicates the teams whose players we want to compute the performance statistics |
A dataframe containing, for each player which fulfils the conditions on the minimum number of shots, the value of the overall performance, the performance difference in S, the propensity to shoot in S, the total number of shots and the total number of shots in the high pressure situation defined
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.
# We consider the high pressure situation of all shots attempted
# when the shotclock value is below 2 seconds
PbP <- PbPmanipulation(PbP.BDB)
PbP <- scoredifference(PbP_data = PbP, team_name = "GSW", player_data=Pbox, team_data = Tadd)
PbP <- shotclock(PbP_data = PbP, sec_14_after_oreb = FALSE, team_data = Tadd)
shotperformance(PbP_data = PbP, player_data = Pbox, team_data = Tadd,
shotclock_interval = c(0, 2) , shot_type = "2P")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.