plot.shotperformance: Plots a bubbleplot representing the data contained in the...

View source: R/plot.shotperformance.R

plot.shotperformanceR Documentation

Plots a bubbleplot representing the data contained in the dataframe produced by the function 'shotperformance'

Description

Plots a bubbleplot representing the data contained in the dataframe produced by the function 'shotperformance'

Usage

## S3 method for class 'shotperformance'
plot(x, title = "Shooting performance", ...)

Arguments

x

an object of class ashotperformance obtained using the shotperformance function

title

character, plot title.

...

other graphical parameters.

Value

A ggplot2 object

Author(s)

Andrea Fox

References

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.

Examples

# Draw the plot for the performances on 2 point shots, when the high pressure situation is
# the one regarding shots taken when \code{shotclock} is between 0 and 2

PbP <- PbPmanipulation(PbP.BDB)
PbP <- scoredifference(PbP, team_name = "GSW", player_data=Pbox, team_data = Tadd)
PbP <- shotclock(PbP, sec_14_after_oreb = FALSE, team_data = Tadd)
players_perf <- shotperformance(PbP, shotclock_interval = c(0, 2),
                                player_data=Pbox, team_data = Tadd,
                                shot_type = "2P", teams = "GSW")
plot(players_perf)

sndmrc/BasketAnalyzeR documentation built on June 6, 2023, 12:52 a.m.