Packages

SB Pitch

Statsbomb have released a free dataset to help the public get used to their data product but also provide data to kick start people's journey into football analytics.

To help people on their journey I have created a R package that creates customisable plots of pitches in ggplot2 that allows event data to be plotted on top.

I have also created some tutorials to help others explore the data, including one that remakes the pitch within this package.

Installation



Installation is straight forward via the devtools package and the install_github() function.


    devtools::install_github("FCrSTATS/SBpitch")


The Default Plot



The package offers lots of customisable features but the default plot.


    create_Pitch()


Just Basic Features




    create_Pitch(BasicFeatures = TRUE)


Middle Third Shading




    create_Pitch(middlethird = TRUE))


Goal Type



Line


    create_Pitch(goaltype = "line")



Box


    create_Pitch(goaltype = "box")



Barca Numbers


  create_Pitch(goaltype = "barcanumbers")


Juego de Posicion




    create_Pitch(JdeP = TRUE)


Colour Schemes



There are 4 elements that you can change the colour of, the grass, the lines, the background and the goal. Here are some examples:

Blue Example


    create_Pitch(grass_colour = "#224C56",
    line_colour =  "#B3CED9",
    background_colour = "#224C56",
    goal_colour = "#15393D")



Night Example


    create_Pitch(grass_colour = "#202020",
    line_colour =  "#797876",
    background_colour = "#202020",
    goal_colour = "#131313")


Green Example


    create_Pitch(grass_colour = "#538032",
    line_colour =  "#ffffff",
    background_colour = "#538032",
    goal_colour = "#000000")