Learn R Programming

BAwiR (version 1.4)

do_viz_shots_gradient: Visualization of the shots statistics with advanced features

Description

Create a visualization of the left half of the court and compare either the field goal percentage or the points per shot of a given player with respect to the league. In addition, it can also show a heatmap with the zones where the player takes the shots.

Usage

do_viz_shots_gradient(data_filter, type, metric, data_shots_zones, language = "English")

Value

A plot.

Arguments

data_filter

Shooting filtered data obtained with do_filter_data.

type

Options are 'team' for team statistics, 'player' for player statistics and 'all' for the whole league.

metric

Options are 'fg' for the field goal percentage, 'pps' for the points per shot and 'none' if plotting a heatmap is preferred.

data_shots_zones

Shooting data with the court zones.

language

Language of the titles. Valid options are 'English' and 'Spanish' so far.

Author

Guillermo Vinue

See Also

do_divide_court_zones, do_filter_data, do_shots_stats, do_prepare_data_gradient

Examples

Run this code
if (FALSE) {
df0 <- do_divide_court_zones(acb_shooting_data_2425)

df1 <- do_filter_data(df0, "2024-2025", "", "", "", "", "")

do_viz_shots_gradient(df1, "all", "none", df0)

df1 <- do_filter_data(df0, "2024-2025", "", "", "", "", "D. Ennis")

do_viz_shots_gradient(df1, "player", "none", df0)
do_viz_shots_gradient(df1, "player", "fg", df0)
}

Run the code above in your browser using DataLab