plot_voronoi | R Documentation |
The function allows for creation of voronoi diagrams on a football pitch with either Opta or Statsbomb data.
plot_voronoi(
data,
data_type = "statsbomb",
colour = "#E74C3C",
fill = "",
alpha = 0.4,
title = "",
theme = "dark"
)
data |
Dataframe that houses pass data. Opta/Statsbomb dataframe must contain atleast the following columns: |
data_type |
Type of data that is being put in: opta or statsbomb. Default set to "statsbomb". |
colour |
The colour of the points in the voronoi plot. |
fill |
Name of column to add a fill component to the plot |
alpha |
Alpha value for opacity of fill. Default set to 0.4 |
title |
Title of the plot. |
theme |
Indicates what theme the map must be shown in: dark (default), white, rose, almond. |
a ggplot2 object
## Not run:
plot <- plot_voronoi(data = data, colour = "blue", title = "Team 1")
plot
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.