Team: R6 Class Representing a Team

Description Details Public fields Methods Examples

Description

The [FPL$get_team()] and [FPL$get_teams()] methods return objects of class 'Team'.

Details

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

Public fields

team

A 'data.frame'. Data for a single Premier League team.

players

A 'data.frame'. Player data for a single Premier League team. Empty by default unless the [FPL$get_players()] method is called.

Methods

Public methods


Method new()

Instantiate the 'Team' class.

Usage
Team$new(team)
Arguments
team

A 'data.frame'. Data for a single Premier League team.

Returns

An R6 object of class 'Team'.

Examples
fpl <- FPL$new()
team <- fpl$get_team(11)

Method get_players()

Get information about specific players from the 'team'.

Usage
Team$get_players()
Returns

A 'list' of R6 'Player' objects who play for the 'Team'.

Examples
team$get_players()


Method print()

Pretty printing of the 'Team'.

Usage
Team$print(...)
Arguments
...

Not used.


Method clone()

The objects of this class are cloneable with this method.

Usage
Team$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## ------------------------------------------------
## Method `Team$new`
## ------------------------------------------------

fpl <- FPL$new()
team <- fpl$get_team(11)

## ------------------------------------------------
## Method `Team$get_players`
## ------------------------------------------------

team$get_players()

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