get_model_data: Combine past form, xG, fixture history and league position

View source: R/get_model_data.R

get_model_dataR Documentation

Combine past form, xG, fixture history and league position

Description

Joins team averages for goals and form, past fixture history, league position in season and xG averages in recent games.

Usage

get_model_data(x = form_fixture_history_league_position())

Arguments

x

A data.frame of joined form and fixture history given by form_fixture_history_league_position()

Value

This function returns a data.frame with the following columns:

team

Character values for the team

fixture

Character represening the fixture i.e. Arsenal v Everton

date

Character values for the date that the match was played

fthg

Numeric fulltime home goals scored in the fixture

ftag

Numeric fulltime away goals scored in the fixture

form

Numeric running average of points accumulated (3 for a win, 1 for a draw) either home or away

scored

Numeric running average of goals scored either home or away

conceded

Numeric running average of goals conceded either home or away

home

Numeric logical represnting whether the team was home or away

win

Numeric logical represnting whether the team won the fixture

draw

Numeric logical represnting whether the team drew the fixture

sf_scored

Numeric running average of goals scored either home or away

sf_conceded

Numeric running average of goals conceded either home or away

season

Character representing the premier league season

points

Numeric representing the points gained by the team in the fixture

cum_points

Numeric representing the cumulative points gained by the team after n games in the season

game

Numeric representing the game count. A team will play 38 games in the modern era of the premier league

league_pos

Numeric representing a team's league position after n games in a season

Author(s)

Daf Howells <dafhowells@yahoo.co.uk>

Examples

## Not run: 
model_data <- get_model_data()

## End(Not run)

dafyddhowells/randy documentation built on Nov. 1, 2022, 4:01 p.m.