The [FPL$get_user()] method returns an object of class `User`.
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.
new()
Instantiate the `User` class.
User$new(user)
user
`list`. Data for a single FPL user.
An R6 `User` object.
fpl <- FPL$new() user <- fpl$get_user(555690)
get_gameweek_history()
Get the gameweek history for the user.
User$get_gameweek_history(gameweek = NULL)
gameweek
`numeric(n)`. The gameweek history to return (default: `NULL` returns all gameweeks).
A `data.frame`.
user$get_gameweek_history()
get_season_history()
Get the seasonal history for the user.
User$get_season_history()
A `data.frame`.
user$get_season_history()
get_chips_history()
Get the chip history for the user.
User$get_chips_history(gameweek = NULL)
gameweek
`numeric(n)`. The gameweek history to return (default: `NULL` returns all gameweeks).
A `data.frame`.
user$get_gameweek_history()
get_picks()
Get the user's picks for the chosen `gameweek`(s).
User$get_picks(gameweek = NULL)
gameweek
`numeric(n)`. The gameweek picks to return (default: `NULL` returns all gameweeks).
A `list` containing the user's picks details for the chosen gameweek(s).
user$get_picks()
get_cup_status()
Get the user's cup status.
User$get_cup_status()
A `list` of cup status information.
user$get_cup_status()
get_cup_matches()
Get the user's cup matches.
User$get_cup_matches(gameweek = NULL)
gameweek
`numeric(n)`. The gameweek history to return (default: `NULL` returns all gameweeks).
A `list` of cup match information.
user$get_cup_matches()
get_active_chips()
Get the user's active chip for each gameweek or the active chip of the chosen `gameweek`(s).
User$get_active_chips(gameweek = NULL)
gameweek
`numeric(n)`. The gameweek history to return (default: `NULL` returns all gameweeks).
A vector of active chips.
user$get_active_chips()
get_automatic_substitutions()
Get a `list` of automatic substitutions for the chosen `gameweek`(s).
User$get_automatic_substitutions(gameweek = NULL)
gameweek
`numeric(n)`. The gameweek history to return (default: `NULL` returns all gameweeks).
A vector of active chips.
user$get_automatic_substitutions()
get_user_history()
Get a `list` of the user's `gameweek` history.
User$get_user_history(gameweek = NULL)
gameweek
`numeric(n)`. The gameweek history to return (default: `NULL` returns all gameweeks).
A `list` of `data.frame`s of the user's gameweek history.
user$get_user_history()
get_transfers()
Get a `list` of all the user's transfers, or a `list` of transfers made in the given `gameweek`(s).
User$get_transfers(gameweek = NULL)
gameweek
`numeric(n)`. The gameweek history to return (default: `NULL` returns all gameweeks).
A `list` of the user's transfers.
user$get_transfers()
print()
Pretty printing of the `User`.
User$print(...)
...
Not used.
clone()
The objects of this class are cloneable with this method.
User$clone(deep = FALSE)
deep
Whether to make a deep clone.
## ------------------------------------------------ ## 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.