Skip to contents

This function takes in a dataframe and binsizes to make a passflow map. Compatible, for right now, with StatsBomb data only. Returns a ggplot object

Usage

plot_passflow(data, data_type = "statsbomb", binwidth = 0)

Arguments

data

Dataframe that must house pass data only and must contain atleast the following columns: x, y, finalX, finalY

data_type

Type of data that is being put in: opta or statsbomb. Default set to "statsbomb"

binwidth

Details the bin size the passflow needs to bin to. The same argument name as the underlying call to geom_bin2d(). Default is 20.

Value

returns a ggplot2 object

Examples

if (FALSE) {
plot <- plot_passflow(data, binwidth = 30)
plot
}