Closed peterdesmet closed 5 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
.
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.
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.
get_taxa
is ready for hard testing, @peterdesmet!
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!
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
. 😄
I think we should close this issue because:
Agreed. If you want to clean up things and remove the function, then you should probably create an issue to do that. 😉
Parameters
If parameter
taxon_keys
:name_usage()
to query e.g. http://api.gbif.org/v1/species/5231190checklist_keys
: assertion errorIf parameter
checklist_keys
:name_usage(datasetKey = ...)
taxon_keys
: assertion errorIf parameter
limit
(e.g. 10)taxon_keys
: limit to 10 taxachecklist_keys
: limit to 10 taxa PER DATASETReturn
key
(= input taxonKey) should be first.limit
,offset
Warning
nameUsage()
: store in vector. At end of retrieving all keys, add those to the returned dataframe, with columnkey
populated and all other columns NA. Also provide warning message, listing the keys that were not found at GBIF. Note: this should never happen with parameterchecklist_keys
. 😄This function should replace:
Documentation