These functions convert various objects to igraph graphs.
as.igraph(x, ...)
All these functions return an igraph graph.
You can use as.igraph()
to convert various objects to igraph graphs.
Right now the following objects are supported:
codeigraphHRG
These objects are created by the fit_hrg()
and
consensus_tree()
functions.
g <- make_full_graph(5) + make_full_graph(5)
hrg <- fit_hrg(g)
as.igraph(hrg)
#> IGRAPH ae454dd DN-- 19 18 -- Fitted HRG
#> + attr: name (g/c), name (v/c), prob (v/n)
#> + edges from ae454dd (vertex names):
#> [1] g1->g4 g2->1 g3->2 g4->g6 g5->8 g6->g2 g7->g9 g8->6 g9->7 g1->g8
#> [11] g2->g3 g3->4 g4->3 g5->9 g6->5 g7->g5 g8->g7 g9->10