These functions convert various objects to igraph graphs.
Details
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()andconsensus_tree()functions.
Related documentation in the C library
create(), vcount(), famous(), empty(), simplify(), is_simple()
Author
Gabor Csardi csardi.gabor@gmail.com.
Examples
g <- make_full_graph(5) + make_full_graph(5)
hrg <- fit_hrg(g)
as.igraph(hrg)
#> ── <igraph> Fitted HRG ────────────────────────────────────────────── 796e406 ──
#> ℹ directed · named
#> ℹ 19 vertices · 18 edges
#>
#> ── Attributes ──────────────────────────────────────────────────────────────────
#> → graph: name <chr>
#> → vertex: name <chr>, prob <dbl>
#>
#> ── Edges (vertex names) ────────────────────────────────────────────────────────
#> [1] g1 → g6 g2 → 8 g3 → g4 g4 → 6 g5 → g3 g6 → g7 g7 → 1 g8 → 2
#> [9] g9 → 4 g1 → g5 g2 → 9 g3 → 7 g4 → 10 g5 → g2 g6 → 3 g7 → g8
#> [17] g8 → g9 g9 → 5
