View source: R/plot_trendline.R
plot_trendline | R Documentation |
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)
plot_trendline(data, team, color_xg, color_xga, rolling_average, theme = "")
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. |
For best clarity, export plot as a 2000x1000 png
## Not run:
plot <- plot_trendline(data = pl, team = "Tottenham",
color_xg = "#08519c", color_xga = "#cb181d",
rolling_average = 10, theme = "dark")
plot
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.