plot_shot | R Documentation |
This function allows for data, that has to be scraped from Understat, to be used for plotting shots.
plot_shot(
data,
type = "",
bins = 30,
highlight_goals = "",
average_location = "",
theme = ""
)
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 |
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 |
a ggplot2 object
## Not run:
plot <- plot_shot(data, type = "hexbin", bins = 20,
average_location = TRUE, highlight_goals = FALSE)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.