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

## ------------------------------------------------ ## Method `Team$new` ## ------------------------------------------------ fpl <- FPL$new() team <- fpl$get_team(11) ## ------------------------------------------------ ## Method `Team$get_players` ## ------------------------------------------------ team$get_players()
#> Error in order(player_id): argument 1 is not a vector