Last active
December 7, 2018 12:30
-
-
Save JoGall/f2d035bad4449b3526c285cb02e44fdb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#devtools::install_github("statsbomb/StatsBombR") #install package | |
#devtools::install_github("jogall/StatsBombR") #or fork for R v<5.0 if necessary | |
library(StatsBombR) | |
# see all free competitions | |
FreeCompetitions() | |
# e.g. get all fixtures from FIFA World Cup | |
fixtures <- FreeMatches(43) | |
# get all events for fixtures | |
dat <- lapply(1:nrow(fixtures), function(i) { | |
temp <- get.matchFree(fixtures[i, ]) | |
Sys.sleep(runif(1, 1, 2)) # be courteous! | |
allclean(temp) | |
}) %>% | |
plyr::rbind.fill() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment