Convert to an igraph object
dag_as_igraph(dag)
An ontology_DAG
object.
An igraph::igraph
object.
If relations
is already set in create_ontology_DAG()
, relations are also set as an edge attribute in the igraph::igraph
object.
parents = c("a", "a", "b", "b", "c", "d")
children = c("b", "c", "c", "d", "e", "f")
dag = create_ontology_DAG(parents, children)
dag_as_igraph(dag)
#> IGRAPH 4acfe3d DN-- 6 6 --
#> + attr: name (v/c)
#> + edges from 4acfe3d (vertex names):
#> [1] a->b a->c b->c b->d c->e d->f