plot_shot: Function for plotting shots

View source: R/plot_shot.R

plot_shotR Documentation

Function for plotting shots

Description

This function allows for data, that has to be scraped from Understat, to be used for plotting shots.

Usage

plot_shot(
  data,
  type = "",
  bins = 30,
  highlight_goals = "",
  average_location = "",
  theme = ""
)

Arguments

data

Dataframe that houses shot data. Dataframe must contain atleast the following columns: X,Y,xG,result,name

type

Type of showcasing the shotmap: hexbin, density, point (default)

bins

Bin size for creating bins. Use this when using hexbin shotmap. The same argument name as the underlying call to geom_hex(). Default = 30.

highlight_goals

to choose to display only the goals in a different color.

average_location

for removing lines denoting average location of shots if need be.

theme

Theme preferences for display: dark (default), white, rose, almond

Value

a ggplot2 object

Examples

## Not run: 
plot <- plot_shot(data, type = "hexbin", bins = 20, 
average_location = TRUE, highlight_goals = FALSE)

## End(Not run)

abhiamishra/ggshakeR documentation built on Aug. 19, 2023, 2 p.m.