Description Usage Arguments Value Examples
Plot hexagon shot chart for a player or set of players.
1 2 | plot_hexes(dat, player, ..., variable = "FGP", cellsize = 15,
scale = TRUE)
|
dat |
Data frame object returned from get_shotchart. |
player |
Player name string or vector of player name strings. |
... |
Additional arguments to pass to filter. |
variable |
One of |
cellsize |
Number of hexagon cells to construct along the x dimension. A larger value results in a finer lattice. |
scale |
Logical. If set to |
Hexagons overlayed on a plot. Note that you need to run the function draw_halfcourt in order to plot the hexgons on the appropriate court.
1 2 3 4 5 6 7 8 9 10 | # plot shots by LeBron James in 2016-17
draw_halfcourt()
plot_hexes(shots_1617, player = "LeBron James", variable = "FGPvLeague",
scale = T, cellsize = 15,
LOC_Y <= 500)
# omit the restricted zone
draw_halfcourt()
plot_hexes(shots_1617, player = "LeBron James", variable = "FGPvLeague",
LOC_Y <= 500, SHOT_ZONE_BASIC != "Restricted Area")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.