draw_shots_on_goal: Takes a data.table with shots, locations (or coordinates) and...

draw_shots_on_goalR Documentation

Takes a data.table with shots, locations (or coordinates) and if goal or not and displays them in around the goal

Description

Takes a data.table with shots, locations (or coordinates) and if goal or not and displays them in around the goal

Usage

draw_shots_on_goal(
  data,
  ihf_pbp = FALSE,
  goal_column = "goal",
  in_goal_position_column = "in_goal_position",
  ...
)

Arguments

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

Value

Plot with the goal and the shots displayed (green are goals and red not goals)

Examples

draw_shots_on_goal(data, TRUE)

telaroz/handbaloner documentation built on Nov. 25, 2024, 2:18 p.m.