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

faoareas function error #123

Closed
emostarda opened this issue Jun 8, 2017 · 4 comments
Closed

faoareas function error #123

emostarda opened this issue Jun 8, 2017 · 4 comments
Labels
Milestone

Comments

@emostarda
Copy link

emostarda commented Jun 8, 2017

Hello,
I tried to extract FAO areas info for all Perciformes:

# I created the dataset
fish <- species_list(Order = "Perciformes")
fish
# I have 10961 obs. of 3 variables
# I tried to extract FAO Areas info from the first 2000 records
> newdata <- faoareas(fish[1:2000])
# I get the following error
Error in UseMethod("left_join") : 
  no applicable method for 'left_join' applied to an object of class "NULL"
In addition: Warning messages:
1: In check_and_parse(resp) : Bad Request (HTTP 400).
2: no results found for query https://fishbase.ropensci.org/faoareas?SpecCode=63845&limit=500&fields=AreaCode%2CSpecCode%2CStatus 

I realize that record 63845 (nr 1337) is the problem. so that > newdata <- faoareas(fish[1:1336]) is working

the next batch works if it starts at 1338 > newdata <- faoareas(fish[1338:2000]) until the next error..

Any idea why?

@sckott sckott added the bug label Jun 8, 2017
@sckott
Copy link
Contributor

sckott commented Jun 8, 2017

Will have a look, thanks @emostarda

@sckott
Copy link
Contributor

sckott commented Jun 8, 2017

was able to reproduce the error - looking into why it happens

@sckott sckott closed this as completed in 3789637 Jun 14, 2017
@sckott
Copy link
Contributor

sckott commented Jun 14, 2017

@emostarda okay, reinstall devtools::install_github("ropensci/rfishbase") and try again,

let me know if it works now

@emostarda
Copy link
Author

Thanks sckott, it's better now as it doesn't crash, it just excludes a number of rows:

Aulopiformes <- species_list(Order = "Aulopiformes")
AulopAreas <- faoareas(Aulopiformes)
Warning messages:
1: In check_and_parse(resp) : Bad Request (HTTP 400).
2: no results found for query https://fishbase.ropensci.org/faoareas?SpecCode=63598&limit=500&fields=AreaCode%2CSpecCode%2CStatus
3: In check_and_parse(resp) : Bad Request (HTTP 400).
4: no results found for query https://fishbase.ropensci.org/faoareas?SpecCode=63599&limit=500&fields=AreaCode%2CSpecCode%2CStatus
5: In check_and_parse(resp) : Bad Request (HTTP 400).
6: no results found for query https://fishbase.ropensci.org/faoareas?SpecCode=64060&limit=500&fields=AreaCode%2CSpecCode%2CStatus

@cboettig cboettig modified the milestone: 2.2.0 Jul 12, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants