Player: R6 Class Representing a Player

Description Details Public fields Active bindings Methods Examples

Description

The [FPL$get_player()] and [FPL$get_players()] methods return objects of class 'Player'.

Details

Information is taken from <https://fantasy.premierleague.com/api/bootstrap-static/>.

Public fields

player

A 'data.frame'. Player data for a single player.

fixtures

A ‘data.frame'. The player’s fixture list for the season.

history

A ‘data.frame'. The current season’s data for a given player. Empty by default unless particular active bindings are called.

history_past

A ‘data.frame'. The player’s summary data for previous seasons.

Active bindings

games_played

'integer(1)'. The number of games the player has partaken in this season.

price

‘numeric(1)'. The player’s in game price.

pp90

'numeric(1)'. Points scored per 90 minutes.

ppm

'numeric(1)'. Points scored per match.

ppmm

'numeric(1)'. Points scored per match per £1M.

vapm

'numeric(1)'. Value added per £1M.

Methods

Public methods


Method new()

Instantiate the 'Player' class.

Usage
Player$new(player)
Arguments
player

A 'data.frame'. Player data for a single player.

Returns

An R6 object of class 'Player'.

Examples
fpl <- FPL$new()
player <- fpl$get_player(250)

Method print()

Pretty printing of the the 'Player'.

Usage
Player$print(...)
Arguments
...

Not used.


Method clone()

The objects of this class are cloneable with this method.

Usage
Player$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.

Examples

1
2
3
4
5
6
## ------------------------------------------------
## Method `Player$new`
## ------------------------------------------------

fpl <- FPL$new()
player <- fpl$get_player(250)

nathaneastwood/fpl documentation built on Nov. 22, 2020, 9:27 p.m.