fJsonToListOfTables | R Documentation |
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.
fJsonToListOfTables(lMatchJson, vcTagsToExtract, nXLimit = 120, nYLimit = 80)
lMatchJson |
refer example |
vcTagsToExtract |
refer example |
nXLimit |
Length of the pitch |
nYLimit |
Breadth of the pitch |
# 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')
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.