draw_shots_on_goal | R Documentation |
Takes a data.table with shots, locations (or coordinates) and if goal or not and displays them in around the goal
draw_shots_on_goal(
data,
ihf_pbp = FALSE,
goal_column = "goal",
in_goal_position_column = "in_goal_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) |
in_goal_position_column |
Name of the column that indicates the in goal position (if data has the IHF PBP format) |
... |
additional parameters to pass to draw_goal |
Plot with the goal and the shots displayed (green are goals and red not goals)
draw_shots_on_goal(data, TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.