# NOT RUN {
data(tromso_extra)
# resample movement dataset to plot 100 movement directions
# (in absence of pass / shot event data as yet)
id8 <- tromso_extra %>%
dplyr::filter(id == 8) %>%
dplyr::sample_n(100)
# 5x5 x,y-bins, 16 angle-bins, blank pitch
soccerPitch(pitchLength, pitchWidth) %>%
soccerSpokes(id8, xBins = 5, angleBins = 16, minLength = 0.4)
# 10x10 x,y-bins, 8 angle-bins, grass pitch
soccerPitch(pitchLength, pitchWidth, grass = T) %>%
soccerSpokes(id8, xBins = 10, angleBins = 8, minLength = 0.2, lwd = 1)
# draw spokes over player heatmap w/ 5x5 x,y-bins, 8 angle-bins
soccerHeatmap(id8, xBins = 5) %>%
soccerSpokes(id8, xBins = 5, angleBins = 8, lwd = 1)
# }
Run the code above in your browser using DataLab