fc_read_events: Read Wyscout soccer events data

Description Usage Arguments Value Note References See Also Examples

View source: R/fc_read_events.R

Description

This function reads and processes the Wyscout events data.

Usage

1
fc_read_events(file, tidy_tibble = TRUE, keep_tags = TRUE)

Arguments

file

File path to events JSON data.

tidy_tibble

Logical value indicating if the returned object should be a tidy tibble or not. If FALSE, a list is returned.

keep_tags

Logical value indicating if tag variables should be included in the returned tidy tibble or not. If tidy_tibble is FALSE, tag variables are always included.

Value

A tidy tibble or list depending on the value of argument tidy_tibble. A detailed description of the variables is given at the reference cited below.

Note

These files are typically the largest and take the longest to process. Expect it to take around two minutes to read in a year of event data for a single league. The variable names in the returned tidy tibble are in snake case, but they are analogous to those used by Wyscout.

The JSON data, events_england.json, included in this package is only a single game of events subsetted from the full publicly available Wyscout England event data.

References

Pappalardo, L., Cintia, P., Rossi, A. et al. A public data set of spatio-temporal match events in soccer competitions. Sci Data 6, 236 (2019). https://doi.org/10.1038/s41597-019-0247-7

All public Wyscout data is available at https://figshare.com/collections/Soccer_match_event_dataset/4415000/2

See Also

Other read functions: fc_read_coaches(), fc_read_competitions(), fc_read_matches(), fc_read_players(), fc_read_teams()

Examples

1
2
3
4
file_path <- system.file("extdata", "events_england.json", package = "scoutr")

events <- fc_read_events(file_path)
events_list <- fc_read_events(file_path, tidy_tibble = FALSE)

shawnsanto/scoutr documentation built on Feb. 27, 2021, 1:02 p.m.