fJsonToListOfTables: Primarily to convert statsbomb files to a list of data.tables

fJsonToListOfTablesR Documentation

Primarily to convert statsbomb files to a list of data.tables

Description

The function has been named generically so that tomorrow it can be used with other json syntaxes as well. As of right now, it has been coded up in a manner that it works with StatsBomb data only.

Usage

fJsonToListOfTables(lMatchJson, vcTagsToExtract, nXLimit = 120, nYLimit = 80)

Arguments

lMatchJson

refer example

vcTagsToExtract

refer example

nXLimit

Length of the pitch

nYLimit

Breadth of the pitch

Examples

# read in the raw json as a list
lMatchJson = rjson::fromJSON(file = cMatchFileName)

# get one table each for the starting XI, passes, and shots
lEvents = fJsonToListOfTables (
   lMatchJson = lMatchJson,
   vcTagsToExtract = c('Starting XI','Pass','Shot')
)

thecomeonman/CodaBonito documentation built on April 24, 2023, 11:41 a.m.