View source: R/get_prem_fixture_history.R
get_prem_fixture_history | R Documentation |
This function returns a breakdown of each team's average points accumulated, goals scored and goals conceded home and away for the same fixture.
get_prem_fixture_history( prem_history = get_prem_history(), home_scored_fixtures_lag = 4, home_conceded_fixtures_lag = 4, away_scored_fixtures_lag = 4, away_conceded_fixtures_lag = 4 )
prem_history |
a |
home_scored_fixtures_lag |
The count of lagged games to calculate average home goals scored. Default is 4 |
home_conceded_fixtures_lag |
The count of lagged games to calculate average home goals conceded. Default is 4 |
away_scored_fixtures_lag |
The count of lagged games to calculate average away goals scored. Default is 4 |
away_conceded_fixtures_lag |
The count of lagged games to calculate average away goals conceded. Default is 4 |
Teams play each other over many seasons and often the outcome follows a certain pattern for e.g. Everton seldom beat Liverpool away. From this we can assess a team's relative attacking and defending strengths in a given fixture over time to use as variables in a model.
This function returns a data.frame
with the following columns:
Character representing a team in a fixture
Character represening the fixture i.e. Arsenal v Everton
Date when the fixture was played
Numeric fulltime home goals scored in the fixture
Numeric fulltime away goals scored in the fixture
Numeric running average of points accumulated (3 for a win, 1 for a draw) either home or away
form
Numeric running average of goals scored either home or away
Numeric running average of goals conceded either home or away
Numeric logical represnting whether the team was home or away
Daf Howells <dafhowells@yahoo.co.uk>
## Not run: prem_history <- get_prem_history() prem_fixture_history_df <- get_prem_fixture_history(prem_history) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.