| getPlayerMatchScores | R Documentation |
Return a dataframe that contains all player scores for a given match ID and list of positions
getPlayerMatchScores(
matches,
token,
positions = NULL,
host = "https://api.impect.com"
)
matches |
'IMPECT' match IDs |
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 |
a dataframe containing the scores aggregated per player and position for the given match ID and list of positions
# Toy example: this will error quickly (no API token)
try(player_match_scores <- getPlayerMatchScores(
matches = c(0, 1),
positions = c("INVALID_POSITION_1", "INVALID_POSITION_2"),
token = "invalid"
))
# Real usage: requires valid Bearer Token from `getAccessToken()`
## Not run:
player_match_scores <- getPlayerMatchScores(
matches = c(84248, 158150),
positions = c("CENTRAL_DEFENDER", "DEFENSE_MIDFIELD"),
token = "yourToken"
)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.