Closed brownag closed 3 years ago
Added another method relative_taxon_code_position
to determine Relative Position of Taxon within Existing Keys. The relative position of a taxon is [number of preceding Key steps] + 1
, or NA
if it does not exist in the lookup table.
This is great, a nice improvement to the relatively simple tables / lists currently in this package. Thanks for adding this. I'll do some testing after it is merged. Thanks for adding it!
For doing the logical ordering like I do in the KST shiny apps
Adds
fourfive new methods and a dataset/lookup table.The first two methods emulate the internal logic of the two shiny apps I created (KSTLookup, KSTPreceding).
decompose_taxon_code
preceding_taxon_codes
The next two methods facilitate mapping between taxon names and their codes / logical order, based on the code:taxon lookup table used for the drop down boxes in both of the apps. The lookup table is defined in a new dataset called
ST_higher_taxa_codes_12th
.taxon_code_to_taxon
taxon_to_taxon_code
And the "relative position" is an application of the above -- the position of a taxon is
[number of preceding Key steps] + 1
, orNA
if it does not exist in the lookup table.relative_taxon_code_position
I wanted the function names to be descriptive of what they did -- so I named as above to be clear.
I recognize that most of the existing methods in this package use camelCase or similar. Would be fine to change these as needed.