draw_shots_on_half_court | R Documentation |
Takes a data.table with shots, locations (or coordinates) and if goal or not and displays them in the court
draw_shots_on_half_court(
data,
ihf_pbp = FALSE,
goal_column = "goal",
shot_position_column = "shot_position",
...
)
data |
Shot data. If ihf_pbp = TRUE, 'in_goal_position_column' and 'goal_column' so that the funcions fills with the x, y coordinates. |
ihf_pbp |
Should be TRUE if we get the shots data from IHF Play by Play. If not, we need the x and y coordinates columns as 'x' and 'y'. goal_column (categorical "0" - "1" ) is needed. |
goal_column |
Name of the column that indicates if there is a goal or not (should be in categorical "0" - "1" format) |
shot_position_column |
Name of the column that indicates the in court position (if data has the IHF PBP format) |
... |
Aditional parameters to pass to 'handbaloner::half_court()' |
Plot with the goal and the shots displayed (green are goals and red not goals)
draw_shots_on_half_court(data, TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.