Root or leaves of the DAG
dag_root(dag, in_labels = TRUE)
dag_leaves(dag, in_labels = TRUE)
dag_is_leaf(dag, terms)
An ontology_DAG
object.
Whether the terms are represented in their names or as integer indices?
A vector of term names.
A character or an integer vector.
parents = c("a", "a", "b", "b", "c", "d")
children = c("b", "c", "c", "d", "e", "f")
dag = create_ontology_DAG(parents, children)
dag_root(dag)
#> [1] "a"
dag_leaves(dag)
#> [1] "e" "f"