Learn R Programming

BAwiR (version 1.4)

do_viz_shots_scatter: Visualization of the shots statistics

Description

Create a visualization of the left half of the court and annotates both the total and by zone shooting statistics. It can also show the location of each individual shot, with color-coding for makes and misses.

Usage

do_viz_shots_scatter(shots_stats, type, draw, size_lab_box = 2.8, size_lab_court = 3, 
                     size_point = 3, language = "English")

Value

A plot.

Arguments

shots_stats

Shooting data associated with the filters given to do_shots_stats.

type

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

draw

Logical. TRUE to add the shots in their coordinates. FALSE to add just the number of mades and attempted field goals.

size_lab_box

Size of the text indicating the overall percentages (they are inside a box).

size_lab_court

Size of the text indicating the percentages by zone.

size_point

Size of the points.

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

Examples

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

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

shots_stats <- do_shots_stats(df1, df0) 

do_viz_shots_scatter(shots_stats, "all", FALSE) 
do_viz_shots_scatter(shots_stats, "all", TRUE)
}

Run the code above in your browser using DataLab