trias-project / unified-checklist

🇧🇪 Global Register of Introduced and Invasive Species - Belgium
https://trias-project.github.io/unified-checklist/
MIT License
0 stars 1 forks source link

Function get_taxa() #1

Closed peterdesmet closed 5 years ago

peterdesmet commented 6 years ago
get_taxa <- function(
    taxon_keys = NULL
    checklist_keys = NULL
    limit = NULL
)

Parameters

If parameter taxon_keys:

If parameter checklist_keys:

If parameter limit (e.g. 10)

Return

key nubKey nameKey  taxonID sourceTaxonKey kingdom ...
134087746  5567657 15913604 2346 NA Plantae ...
5567657 5567657  1439808 gbif:5567657  123978664 Plantae ...

Warning

This function should replace:

Documentation

damianooldoni commented 6 years ago

with single taxon key (a string) Works with vector of taxon keys (vector of strings)

Are taxon keys character? I always used them as numeric.

peterdesmet commented 6 years ago

You're right. However, taxon keys might come from data file where they are defined as character. But OK, let's force user to cast them to integer before passing to function. I'll update issue body.

damianooldoni commented 6 years ago

As discussed, contrarily to documentation, rgbif allows the usage of key as character. name_usage(key = 1) and name_usage(key = "1") give the same output. Based on this, I will update my get_taxa function as well.

damianooldoni commented 6 years ago

get_taxa is ready for hard testing, @peterdesmet!

damianooldoni commented 6 years ago

I cleaned the branch implement-paging&get-taxa-steps of trias package. Now only get_taxa function is visible. Test directory has also been cleaned up with just tests related to get_taxa function. Package reinstalled and succesfully tested. @peterdesmet: check it please one last time. Thanks!

peterdesmet commented 6 years ago

Will do. Note: always good to add a link to the PR: https://github.com/trias-project/trias/pull/3... but well, it's a bit confusing anyway that we made this issues in this repository rather than trias. 😄

damianooldoni commented 5 years ago

I think we should close this issue because:

  1. Function has been implemented, documented and tested. See trias::gbif_get_taxa().
  2. We don't use it anymore actually :rofl:
peterdesmet commented 5 years ago

Agreed. If you want to clean up things and remove the function, then you should probably create an issue to do that. 😉