Learn R Programming

impectR (version 2.5.3)

getPlayerIterationScores: Return a dataframe that contains all player scores for a given iteration ID

Description

Return a dataframe that contains all player scores for a given iteration ID

Usage

getPlayerIterationScores(
  iteration,
  token,
  positions = NULL,
  host = "https://api.impect.com"
)

Value

a dataframe containing the player scores aggregated per player for the given iteration ID and list of positions

Arguments

iteration

'IMPECT' iteration ID

token

bearer token

positions

optional list of position names. Must be one of: "GOALKEEPER", "LEFT_WINGBACK_DEFENDER", "RIGHT_WINGBACK_DEFENDER", "CENTRAL_DEFENDER", "DEFENSE_MIDFIELD", "CENTRAL_MIDFIELD", "ATTACKING_MIDFIELD", "LEFT_WINGER", "RIGHT_WINGER", "CENTER_FORWARD". If not submitted, function will return all positions individually.

host

host environment

Examples

Run this code
# Toy example: this will error quickly (no API token)
try(player_scores <- getPlayerIterationScores(
  iteration = 0,
  positions = c("INVALID_POSITION_1", "INVALID_POSITION_2"),
  token = "invalid"
))

# Real usage: requires valid Bearer Token from `getAccessToken()`
if (FALSE) {
player_scores <- getPlayerIterationScores(
  iteration = 1004,
  positions = c("CENTRAL_DEFENDER", "DEFENSE_MIDFIELD"),
  token = "yourToken"
)
}

Run the code above in your browser using DataLab