Getting error tryng to download data
Bustami opened this issue · 14 comments
Using this code:
library(StatsBombR)
events <- StatsBombFreeEvents()
or
WWC <- FreeMatches(72)
I'm getting this error:
Error: parse error: trailing garbage
404: Not Found
(right here) ------^
Hi,
If you want to pull the Women's World Cup data, use this:
Comp <- FreeCompetitions() %>%
filter(competition_id==72)
Matches <- FreeMatches(Comp)
StatsBombData <- StatsBombFreeEvents(MatchesDF = Matches, Parallel = T)
StatsBombData = allclean(StatsBombData)
HI, thanks for the reply.
I tried it but i got the same error, using the FreeMatches() function
What's the exact code you're running?
Well, the first one was the same i've already published in the first post and then the same that you replied.
library(StatsBombR)
WWC <- FreeMatches(72)
library(StatsBombR)
library(dplyr)
Comp <- FreeCompetitions() %>% filter(competition_id==72)
Matches <- FreeMatches(Comp)
Are you still getting the 'trailing garbage' error? Do you have StatsBombR updated to the latest version? The first bit of code you posted wont work. It needs to know what you're referencing when you refer to '72'. The competition id, in this case.
Yes, getting the same 'trailing garbage' error.
I have the 0.1.0 version.
I just reinstalled using
devtools::install_github("statsbomb/StatsBombR")
But the same result
About the update, ok. (some time ago that code worked).
If you try it with
Comp <- FreeCompetitions() %>%
filter(competition_id==72 & season_name=="2019")
Matches <- FreeMatches(Comp)
StatsBombData <- StatsBombFreeEvents(MatchesDF = Matches, Parallel = T)
StatsBombData = allclean(StatsBombData)
Does that work?
Didn't work either. The error comes with the FreeMatches() part.
Could you run
sessionInfo()
and screenshot the packages, what version they're on? As well as what version of R
OK so quite a few of your packages - tidyr most prominently - are out of date and you're running on an older version of R. Could you try updating those? The code I supplied works fine for me (not helpful I know) so a bit tricky to diagnose from here.
Ok, i'll try it updating tidyr and R versions. Thanks a lot.
Hi @EuanDewar
The codes worked without problems after i updated the R version.
Thanks a lot for your time.
Here the post that i was working (Spanish)
Cheers
Glad to hear. Enjoy using the data!