Learn R Programming

impectR (version 2.5.3)

getEvents: Return a dataframe that contains all events and kpi values for a set of given match IDs

Description

Return a dataframe that contains all events and kpi values for a set of given match IDs

Usage

getEvents(
  matches,
  token,
  include_kpis = TRUE,
  include_set_pieces = FALSE,
  host = "https://api.impect.com"
)

Value

a dataframe containing all events and kpi values for a set of given match IDs

Arguments

matches

'IMPECT' match ID or a list of match IDs

token

bearer token

include_kpis

include KPIs in event data

include_set_pieces

include additional set piece data in event data

host

host environment

Examples

Run this code
# Toy example: this will error quickly (no API token)
try(events <- getEvents(
  matches = c(0, 1),
  token = "invalid",
  include_kpis = T,
  include_set_pieces = F
))

# Real usage: requires valid Bearer Token from `getAccessToken()`
if (FALSE) {
events <- getEvents(
  matches = c(84248, 158150),
  token = "yourToken",
  include_kpis = T,
  include_set_pieces = F
)
}

Run the code above in your browser using DataLab