View source: R/get_xg_fixture_history.R
get_xg_fixture_history | R Documentation |
This function returns a breakdown of each team's rolling average xG for and against both home and away.
get_xg_fixture_history( home_scored_games_lag = 4, home_conceded_games_lag = 4, away_scored_games_lag = 4, away_conceded_games_lag = 4 )
home_scored_games_lag |
The count of lagged games to calculate average home xG. Default is 4, |
home_conceded_games_lag |
The count of lagged games to calculate average home xG against. Default is 4, |
away_scored_games_lag |
The count of lagged games to calculate average away xG. Default is 4, |
away_conceded_games_lag |
The count of lagged games to calculate average away xG against. Default is 4, |
This function returns a data.frame with the following columns
Date when the fixture was played
Character representing a team in a fixture
Character represening the fixture e.g Arsenal v Everton
Character represening the actual score in the fixture e.g. 2-1
Numeric fulltime home xG in the fixture
Numeric fulltime away xG in the fixture
Logical represening whether or not the team was home or away in the fixture
Numeric showing running average of xG for the team
umeric showing running average of xG against the team
Daf Howells <dafhowells@yahoo.co.uk>
## Not run: xg_fixture_history_df <- get_xg_fixture_history() ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.