statsbomb / open-data

Free football data from StatsBomb
https://statsbomb.com/resource-centre/
Other
2.43k stars 767 forks source link

Getting error tryng to download data #10

Closed Bustami closed 5 years ago

Bustami commented 5 years ago

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) ------^

EuanDewar commented 5 years ago

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)

Bustami commented 5 years ago

HI, thanks for the reply. I tried it but i got the same error, using the FreeMatches() function

EuanDewar commented 5 years ago

What's the exact code you're running?

Bustami commented 5 years ago

Well, the first one was the same i've already published in the first post and then the same that you replied.

1) library(StatsBombR) WWC <- FreeMatches(72)

2) library(StatsBombR) library(dplyr) Comp <- FreeCompetitions() %>% filter(competition_id==72)

Matches <- FreeMatches(Comp)

EuanDewar commented 5 years ago

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.

Bustami commented 5 years ago

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).

EuanDewar commented 5 years ago

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?

Bustami commented 5 years ago

Didn't work either. The error comes with the FreeMatches() part.

EuanDewar commented 5 years ago

Could you run sessionInfo() and screenshot the packages, what version they're on? As well as what version of R

Bustami commented 5 years ago

Sure:

image

EuanDewar commented 5 years ago

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.

Bustami commented 5 years ago

Ok, i'll try it updating tidyr and R versions. Thanks a lot.

Bustami commented 5 years ago

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

EuanDewar commented 5 years ago

Glad to hear. Enjoy using the data!