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

tax_name() fails with 'Galagoides demidovii' #560

Closed
villanueval opened this issue Jul 27, 2016 · 6 comments
Closed

tax_name() fails with 'Galagoides demidovii' #560

villanueval opened this issue Jul 27, 2016 · 6 comments
Labels
Milestone

Comments

@villanueval
Copy link
Contributor

Running

tax_name(query = 'Galagoides demidovii', get = "family", db = "itis")

Results in

Retrieving data for taxon 'Galagoides demidovii'

Error in tt$rank : $ operator is invalid for atomic vectors

Tried looking into how tax_name() works and it seems that the problem is when classification() returns not an NA, but this:

> classification(get_tsn('Galagoides demidovii', verbose=TRUE), verbose=verbose)

Retrieving data for taxon 'Galagoides demidovii'

$`944094`
[1] NA

attr(,"class")
[1] "classification"
attr(,"db")
[1] "itis"

get_tsn() doesn't return an NA:

> tsn <- get_tsn( 'Galagoides demidovii', searchtype = "scientific", verbose = TRUE)

Retrieving data for taxon 'Galagoides demidovii'

> tsn
[1] "944094"
attr(,"match")
[1] "found"
attr(,"multiple_matches")
[1] TRUE
attr(,"pattern_match")
[1] TRUE
attr(,"uri")
[1] "http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=944094"
attr(,"class")
[1] "tsn"
> is.na(tsn)
[1] FALSE

So the check here doesn't see it as an NA. Seems to be an issue with what ITIS returns for this species.

@sckott
Copy link
Contributor

sckott commented Jul 27, 2016

thanks, @ljvillanueva what version of taxize and R do you have

@sckott sckott added the bug label Jul 27, 2016
@sckott
Copy link
Contributor

sckott commented Jul 27, 2016

looks like that taxon is invalid http://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=944094

and the api call that classification(get_tsn('Galagoides demidovii')) makes is http://www.itis.gov/ITISWebService/services/ITISWebService/services/ITISService/getFullHierarchyFromTSN?tsn=944094

which returns no taxonomic classification data

so we should handle that better, and not fail when no classification data returned

@sckott sckott added this to the v0.8 milestone Jul 27, 2016
@villanueval
Copy link
Contributor Author

I'm using taxize 0.7.9 in R 3.2.3.

@sckott sckott closed this as completed in 40b6002 Aug 4, 2016
@sckott
Copy link
Contributor

sckott commented Aug 4, 2016

@ljvillanueva reinstall and try again, should be fixed now

@villanueval
Copy link
Contributor Author

Yep, seems to be fixed now. Thanks!

@sckott
Copy link
Contributor

sckott commented Sep 12, 2016

great

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

2 participants