Function Repository Resource:

TaxonomicNearest

Source Notebook

Give the list of taxa to which a specified taxon is nearest

Contributed by: Jofre Espigule-Pons

ResourceFunction["TaxonomicNearest"][taxa,taxon]

gives the subset of taxa to which the specified taxon is nearest.

Details and Options

The taxa can be specified as a list of Entity objects such as {Entity["Species","Species:HomoSapiens"],Entity["Plant","Genus:Helianthus"]}, or as a list of strings such as {"human","koala","dog"}.
Valid forms of taxon include Entity["Species","taxon"], Entity["Plant","taxon"] and strings.

Examples

Basic Examples (3) 

Interpret animals, generating Entity objects and computing the nearest taxa to the specified taxon:

In[1]:=
ResourceFunction[
 "TaxonomicNearest"][{"bear", "polar bear", "black bear", "red panda",
   "panda", "raccoon"}, "grizzly"]
Out[1]=

Interpret plants, generating Entity objects and computing the nearest taxa to the specified taxon:

In[2]:=
ResourceFunction[
 "TaxonomicNearest"][{"rose", "tomato", "potato", "garlic", "pumpkin",
   "oak"}, "onion"]
Out[2]=

Compute the nearest taxa to the specified taxon:

In[3]:=
ResourceFunction[
 "TaxonomicNearest"][{Entity["Species", "Genus:Rattus"], Entity["Species", "Species:FelisCatus"], Entity["Species", "Species:SusDomestica"], Entity["Species", "Genus:Lemur"]}, Entity["Species", "Species:HomoSapiens"]]
Out[3]=

Applications (1) 

Compute the nearest taxa to the specified taxon using EntityClass and EntityList:

In[4]:=
ResourceFunction["TaxonomicNearest"][
 EntityList[EntityClass["Species", "EndangeredSpecies"]], Entity["Species", "Species:HomoSapiens"]]
Out[4]=

Neat Examples (1) 

Create a quiz to test your zoology knowledge:

In[5]:=
With[{entities = RandomSample[
    EntityList[EntityClass["Species", "EndangeredSpecies"]], 4]},
 Column@{Style["What are the nearest taxa to Homo Sapiens?", FontFamily -> "Helvetica", Bold, 18], CheckboxBar[Dynamic[x], entities], Button[Style["Click here to check answer", FontFamily -> "Helvetica", 16], Print[Column[
      ResourceFunction["TaxonomicNearest"][Rest@entities, "human"]]]]}]
Out[5]=

Publisher

Jofre Espigule-Pons

Version History

  • 1.0.0 – 15 October 2019

Related Resources

License Information