powered by
Draw a shotmap on a half pitch from StatsBomb data. Compatability with other (non-StatsBomb) shot data will be added soon.
soccerShotmap(dat, lengthPitch = 105, widthPitch = 68, colGoal = "skyblue", colMiss = "grey60", alpha = 0.8, legend = FALSE, theme = c("light", "dark", "grass"), lwd = 0.5)
length and width of pitch in metres
colour of points representing scored and missed shots
transparency of points
boolean, include legend or not
numeric, pitch line width
pitch background and line colour
if TRUE, uses a more realistic pitch
TRUE
a ggplot object
soccerPitchBG for drawing a soccer pitch as foreground over an existing ggplot object
soccerPitchBG
# NOT RUN { data(statsbomb) # shot map of France vs. Argentina (2018-06-30) statsbomb %>% filter(team.name == "France") %>% soccerShotmap() # }
Run the code above in your browser using DataLab