is_descendant | R Documentation |
Tests which in a list of candidate terms are ancestors to or descendants of the query term. Note that terms are not considered ancestors and descendants of themselves.
is_descendant(term, candidates, includeRels = c("none", "part_of"))
is_ancestor(term, candidates, includeRels = c("none", "part_of"))
term |
character, the label (name) or IRI of the query term |
candidates |
character, the list of candidate term names or IRIs |
includeRels |
character, the relationships R for which to include
subclasses of expressions "R some T", where for |
Any of both the query term and the list of candidate terms can be supplied
as labels (names), or as IRIs. The function will first resolve any labels
to IRIs, allowing any ontology as the target. If labels aren't unique enough
across ontologies, it is advisable to do the resolution before calling these
functions, using get_term_iri()
with the appropriate ontology set.
A logical vector indicating which candidate terms are ancestors and descendants, respectively, of the query term.
# taxa:
is_descendant("Halecostomi", c("Halecostomi", "Icteria", "Sciaenidae"))
is_ancestor("Sciaenidae", c("Halecostomi", "Abeomelomys", "Sciaenidae"))
# anatomical entities:
is_descendant("paired fin", c("pectoral fin", "pelvic fin", "dorsal fin"))
is_descendant("paired fin", c("pelvic fin", "pelvic fin ray"))
is_descendant("paired fin", c("pelvic fin", "pelvic fin ray"), includeRels = "part_of")
is_ancestor("pelvic fin", c("paired fin", "hindlimb", "fin"))
is_ancestor("pelvic fin ray", c("paired fin", "fin"))
is_ancestor("pelvic fin ray", c("paired fin", "fin"), includeRels = "part_of")
# phenotypic quality
is_ancestor("triangular", c("shape", "color", "amount"))
is_descendant("shape", c("T-shaped", "star shaped", "yellow"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.