Function for plotting xG Trendline with FBref/ StatsBomb data.
Source:R/plot_trendline.R
plot_trendline.Rd
The data can be scraped from FBref.
Dataframe passed in must have the following column names:
Date (format: year-month-day).yyyy-mm-dd,
Home_xG (xG for Home Team),
Away_xG (xG for Away Team),
Home (Home Team),
Away (Away Team)
Arguments
- data
is for the dataset used. Select the number of matches wanted in the viz beforehand.
- team
is to select the specific team for the viz. Team must be accurate as per FBref specifications.
- color_xg
is for selecting color for xGoals.
- color_xga
is for selecting the color for xGoalsAgainst.
- rolling_average
is for setting the rolling average for the data.
- theme
to select the theme from 4 options -> dark, almond, rose, white.