taxmap
utility functions to taxonomy
I noticed that the edge list in taxonomy
does not have an edge for each taxon.
This is different than how it was structured in metacoder
and this is making adapting functions like supertaxa
more difficult than I thought.
Also, the algolrythm used to construct the edge list involves an all-vs-all comparison of taxon
objects.
I think I had originally done something like this in metacoder
, but eventully opted for a recursive strategy to make it faster on large datasets.
However, I dont think I have ever taken into account situations like:
a > b > c b > c
Something to look into...
I think I have a non-recursive way to make an edge list from hierarchies.
mammalia <- taxon( name = taxon_name("Mammalia"), rank = taxon_rank("class"), id = taxon_id(9681) ) plantae <- taxon( name = taxon_name("Plantae"), rank = taxon_rank("kingdom"), id = taxon_id(33090) ) unidentified <- taxon( name = taxon_name("unidentified"), rank = taxon_rank("species"), id = taxon_id(0) ) x <- taxonomy(unidentified_plant, unidentified_animal) > x <Taxonomy> 3 taxa: 1. Plantae, 2. unidentified, 3. Mammalia 2 edges: 1->2, 3->2
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.