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

Maintain order #561

Closed
bomeara opened this issue Aug 3, 2016 · 2 comments
Closed

Maintain order #561

bomeara opened this issue Aug 3, 2016 · 2 comments
Assignees
Labels
Milestone

Comments

@bomeara
Copy link
Contributor

bomeara commented Aug 3, 2016

Recently almost made a very bad mistake, assuming that the order of returned names with best_match_only=TRUE was the same as the input names. Not so.

> gnr_resolve(names = c("Helianthus annuus", "Homo sapiens"), best_match_only=TRUE)
  user_supplied_name    submitted_name      matched_name data_source_title score
1  Helianthus annuus Helianthus annuus Helianthus annuus              NCBI 0.988
2       Homo sapiens      Homo sapiens      Homo sapiens              NCBI 0.988

which is in the example works fine, but

>  gnr_resolve(names = c("Homo sapiens", "Helianthus annuus"), best_match_only=TRUE)
  user_supplied_name    submitted_name      matched_name data_source_title score
1  Helianthus annuus Helianthus annuus Helianthus annuus              NCBI 0.988
2       Homo sapiens      Homo sapiens      Homo sapiens              NCBI 0.988

returns results in a new order.

I'd suggest maintaining the order or at least making a warning() that people shouldn't expect the same order to be returned. I'm not sure if this is true for other resolvers, too.

@sckott sckott added this to the v0.8 milestone Aug 3, 2016
@sckott sckott self-assigned this Aug 3, 2016
@sckott sckott added the bug label Aug 3, 2016
sckott added a commit that referenced this issue Aug 3, 2016
…tput data.frame

added test to test for order of names back from gnr_resolve
bumped dev version
@sckott
Copy link
Contributor

sckott commented Aug 3, 2016

thanks @bomeara

I started to fix this in #559 in commit 3ae4ad4 but missed one route where it's still sorted.

just pushed a change - reinstall devtools::install_github("ropensci/taxize") - should work now

@bomeara
Copy link
Contributor Author

bomeara commented Aug 3, 2016

Yup, thanks, @sckott . The new code works 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