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

## ------------------------------------------------ ## Method `User$new` ## ------------------------------------------------ fpl <- FPL$new() user <- fpl$get_user(555690) ## ------------------------------------------------ ## Method `User$get_gameweek_history` ## ------------------------------------------------ user$get_gameweek_history()
#> Error in .deserialize_json(json = json, query = query, empty_array = empty_array, empty_object = empty_object, single_null = single_null, parse_error_ok = parse_error_ok, on_parse_error = on_parse_error, query_error_ok = query_error_ok, on_query_error = on_query_error, simplify_to = max_simplify_lvl, type_policy = type_policy, int64_r_type = int64_policy): The JSON document has an improper structure: missing or superfluous commas, braces, missing keys, etc.
## ------------------------------------------------ ## Method `User$get_season_history` ## ------------------------------------------------ user$get_season_history()
#> Error in .deserialize_json(json = json, query = query, empty_array = empty_array, empty_object = empty_object, single_null = single_null, parse_error_ok = parse_error_ok, on_parse_error = on_parse_error, query_error_ok = query_error_ok, on_query_error = on_query_error, simplify_to = max_simplify_lvl, type_policy = type_policy, int64_r_type = int64_policy): The JSON document has an improper structure: missing or superfluous commas, braces, missing keys, etc.
## ------------------------------------------------ ## Method `User$get_chips_history` ## ------------------------------------------------ user$get_gameweek_history()
#> Error in .deserialize_json(json = json, query = query, empty_array = empty_array, empty_object = empty_object, single_null = single_null, parse_error_ok = parse_error_ok, on_parse_error = on_parse_error, query_error_ok = query_error_ok, on_query_error = on_query_error, simplify_to = max_simplify_lvl, type_policy = type_policy, int64_r_type = int64_policy): The JSON document has an improper structure: missing or superfluous commas, braces, missing keys, etc.
## ------------------------------------------------ ## Method `User$get_picks` ## ------------------------------------------------ user$get_picks()
#> Error in seq.default(self$user$started_event, self$user$current_event): 'from' must be of length 1
## ------------------------------------------------ ## Method `User$get_cup_status` ## ------------------------------------------------ user$get_cup_status()
#> Error in .deserialize_json(json = json, query = query, empty_array = empty_array, empty_object = empty_object, single_null = single_null, parse_error_ok = parse_error_ok, on_parse_error = on_parse_error, query_error_ok = query_error_ok, on_query_error = on_query_error, simplify_to = max_simplify_lvl, type_policy = type_policy, int64_r_type = int64_policy): The JSON document has an improper structure: missing or superfluous commas, braces, missing keys, etc.
## ------------------------------------------------ ## Method `User$get_cup_matches` ## ------------------------------------------------ user$get_cup_matches()
#> Error in .deserialize_json(json = json, query = query, empty_array = empty_array, empty_object = empty_object, single_null = single_null, parse_error_ok = parse_error_ok, on_parse_error = on_parse_error, query_error_ok = query_error_ok, on_query_error = on_query_error, simplify_to = max_simplify_lvl, type_policy = type_policy, int64_r_type = int64_policy): The JSON document has an improper structure: missing or superfluous commas, braces, missing keys, etc.
## ------------------------------------------------ ## Method `User$get_active_chips` ## ------------------------------------------------ user$get_active_chips()
#> Error in seq.default(self$user$started_event, self$user$current_event): 'from' must be of length 1
## ------------------------------------------------ ## Method `User$get_automatic_substitutions` ## ------------------------------------------------ user$get_automatic_substitutions()
#> Error in seq.default(self$user$started_event, self$user$current_event): 'from' must be of length 1
## ------------------------------------------------ ## Method `User$get_user_history` ## ------------------------------------------------ user$get_user_history()
#> Error in seq.default(self$user$started_event, self$user$current_event): 'from' must be of length 1
## ------------------------------------------------ ## Method `User$get_transfers` ## ------------------------------------------------ user$get_transfers()
#> Error in .deserialize_json(json = json, query = query, empty_array = empty_array, empty_object = empty_object, single_null = single_null, parse_error_ok = parse_error_ok, on_parse_error = on_parse_error, query_error_ok = query_error_ok, on_query_error = on_query_error, simplify_to = max_simplify_lvl, type_policy = type_policy, int64_r_type = int64_policy): The JSON document has an improper structure: missing or superfluous commas, braces, missing keys, etc.