Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in read.socrata #191

Closed
ecorreig opened this issue Sep 10, 2020 · 3 comments
Closed

Error in read.socrata #191

ecorreig opened this issue Sep 10, 2020 · 3 comments

Comments

@ecorreig
Copy link

ecorreig commented Sep 10, 2020

I'm trying to download data from this link:

"https://dev.socrata.com/foundry/analisi.transparenciacatalunya.cat/jj6z-iyrp" by doing:

df <- RSocrata::read.socrata("https://dev.socrata.com/foundry/analisi.transparenciacatalunya.cat/jj6z-iyrp", stringsAsFactors = F)

But I get the following error:

Error in while (nrow(page) > 0 & !limitProvided) { : 
  argument is of length zero

The data is correct because in python, with sodapy, I can access without issue, so I don't know what might be hapenning...

Thanks,
Eudald

@nicklucius
Copy link
Contributor

Hi @ecorreig, thanks for the report. I think the issue is that the URL is not an actual dataset URL, which read.socrata() is expecting, but instead is a Socrata documentation page. I noticed the documentation does contain a API link which is compatible with read.socrata(). Could you try:

df <- RSocrata::read.socrata("https://analisi.transparenciacatalunya.cat/resource/jj6z-iyrp.json", stringsAsFactors = F)

@ecorreig
Copy link
Author

Wow,I thought I had tried this before writing... Thanks a lot!

Regardless, maybe a specific error message for dumb people like me?

@nicklucius
Copy link
Contributor

No worries!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants