Learn R Programming

StatsBombR (version 0.1.0)

alllineups: This function returns all lineups from the matches specified in the arguments.

Description

For use with the StatsBomb Data API credentials. This function is used to access the JSON file from the StatsBomb API and format it as a data frame (tibble) for use in R. Currently, this function only supports one season and one competition at a time. This function can simply be run multiple times for different seasons and competitions and then bound together. Currently, parallel is only supported for windows.

Usage

alllineups(username = "username", password = "password", matches$match_id, version = "v1",
                        baseurl = "https://data.statsbombservices.com/api/", parallel = T)

Arguments

username

Character object of your StatsBomb API username.

password

Character object of your StatsBomb API password.

match_id

Character vector of the matches you wish to access.

Parallel

Boolean variable for whether or not you want to gather in parallel (much faster).

version

Character string of the version of the StatsBomb API you wish to access. Currently version v1, v2, v3 and v4 are supported.

Value

df

Returns a data frame with all lineups for the matches specified.

Examples

Run this code
# NOT RUN {
lineups <- alllineups(username = username, password = password, matches.epl$match_id, parallel = T)
# }

Run the code above in your browser using DataLab