User: R6 Class Representing a User

Description Public fields Methods Examples

Description

The [FPL$get_user()] method returns an object of class 'User'.

Public fields

user

A 'list' of user details.

history

A 'list' of 'data.frame's containing the historic gameweek performance data for the user.

cup

A ‘list' of data related to the user’s cup performance.

picks

A ‘list' of the user’s picks information for each gameweek.

transfers

A ‘list' of the user’s weekly transfers.

Methods

Public methods


Method new()

Instantiate the 'User' class.

Usage
User$new(user)
Arguments
user

'list'. Data for a single FPL user.

Returns

An R6 'User' object.

Examples
fpl <- FPL$new()
user <- fpl$get_user(555690)

Method get_gameweek_history()

Get the gameweek history for the user.

Usage
User$get_gameweek_history(gameweek = NULL)
Arguments
gameweek

'numeric(n)'. The gameweek history to return (default: 'NULL' returns all gameweeks).

Returns

A 'data.frame'.

Examples
user$get_gameweek_history()

Method get_season_history()

Get the seasonal history for the user.

Usage
User$get_season_history()
Returns

A 'data.frame'.

Examples
user$get_season_history()

Method get_chips_history()

Get the chip history for the user.

Usage
User$get_chips_history(gameweek = NULL)
Arguments
gameweek

'numeric(n)'. The gameweek history to return (default: 'NULL' returns all gameweeks).

Returns

A 'data.frame'.

Examples
user$get_gameweek_history()

Method get_picks()

Get the user's picks for the chosen 'gameweek'(s).

Usage
User$get_picks(gameweek = NULL)
Arguments
gameweek

'numeric(n)'. The gameweek picks to return (default: 'NULL' returns all gameweeks).

Returns

A ‘list' containing the user’s picks details for the chosen gameweek(s).

Examples
user$get_picks()

Method get_cup_status()

Get the user's cup status.

Usage
User$get_cup_status()
Returns

A 'list' of cup status information.

Examples
user$get_cup_status()

Method get_cup_matches()

Get the user's cup matches.

Usage
User$get_cup_matches(gameweek = NULL)
Arguments
gameweek

'numeric(n)'. The gameweek history to return (default: 'NULL' returns all gameweeks).

Returns

A 'list' of cup match information.

Examples
user$get_cup_matches()

Method get_active_chips()

Get the user's active chip for each gameweek or the active chip of the chosen 'gameweek'(s).

Usage
User$get_active_chips(gameweek = NULL)
Arguments
gameweek

'numeric(n)'. The gameweek history to return (default: 'NULL' returns all gameweeks).

Returns

A vector of active chips.

Examples
user$get_active_chips()

Method get_automatic_substitutions()

Get a 'list' of automatic substitutions for the chosen 'gameweek'(s).

Usage
User$get_automatic_substitutions(gameweek = NULL)
Arguments
gameweek

'numeric(n)'. The gameweek history to return (default: 'NULL' returns all gameweeks).

Returns

A vector of active chips.

Examples
user$get_automatic_substitutions()

Method get_user_history()

Get a ‘list' of the user’s 'gameweek' history.

Usage
User$get_user_history(gameweek = NULL)
Arguments
gameweek

'numeric(n)'. The gameweek history to return (default: 'NULL' returns all gameweeks).

Returns

A ‘list' of 'data.frame's of the user’s gameweek history.

Examples
user$get_user_history()

Method get_transfers()

Get a ‘list' of all the user’s transfers, or a 'list' of transfers made in the given 'gameweek'(s).

Usage
User$get_transfers(gameweek = NULL)
Arguments
gameweek

'numeric(n)'. The gameweek history to return (default: 'NULL' returns all gameweeks).

Returns

A ‘list' of the user’s transfers.

Examples
user$get_transfers()

Method print()

Pretty printing of the 'User'.

Usage
User$print(...)
Arguments
...

Not used.


Method clone()

The objects of this class are cloneable with this method.

Usage
User$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
## ------------------------------------------------
## Method `User$new`
## ------------------------------------------------

fpl <- FPL$new()
user <- fpl$get_user(555690)

## ------------------------------------------------
## Method `User$get_gameweek_history`
## ------------------------------------------------

user$get_gameweek_history()

## ------------------------------------------------
## Method `User$get_season_history`
## ------------------------------------------------

user$get_season_history()

## ------------------------------------------------
## Method `User$get_chips_history`
## ------------------------------------------------

user$get_gameweek_history()

## ------------------------------------------------
## Method `User$get_picks`
## ------------------------------------------------

user$get_picks()

## ------------------------------------------------
## Method `User$get_cup_status`
## ------------------------------------------------

user$get_cup_status()

## ------------------------------------------------
## Method `User$get_cup_matches`
## ------------------------------------------------

user$get_cup_matches()

## ------------------------------------------------
## Method `User$get_active_chips`
## ------------------------------------------------

user$get_active_chips()

## ------------------------------------------------
## Method `User$get_automatic_substitutions`
## ------------------------------------------------

user$get_automatic_substitutions()

## ------------------------------------------------
## Method `User$get_user_history`
## ------------------------------------------------

user$get_user_history()

## ------------------------------------------------
## Method `User$get_transfers`
## ------------------------------------------------

user$get_transfers()

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