View source: R/do_viz_shots_gradient.R
| do_viz_shots_gradient | R Documentation |
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.
do_viz_shots_gradient(data_filter, type, metric, data_shots_zones, language = "English")
data_filter |
Shooting filtered data obtained with |
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. |
A plot.
Guillermo Vinue
do_divide_court_zones, do_filter_data,
do_shots_stats, do_prepare_data_gradient
## Not run:
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)
df1 <- do_filter_data(df0, "2024-2025", "Valencia Basket", "", "", "", "")
do_viz_shots_gradient(df1, "team", "none", df0)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.