This is a generic function to convert R objects to igraph graphs.
Related documentation in the C library
vcount(), simplify(), is_simple(), edges(), get_eids(), ecount()
Examples
## These are equivalent
graph_(cbind(1:5, 2:6), from_edgelist(directed = FALSE))
#> Warning: `graph_()` was deprecated in igraph 2.1.0.
#> ℹ Please use constructors directly, for instance graph_from_edgelist().
#> ℹ graph_() will be removed in a future version of igraph.
#> ── <igraph> ───────────────────────────────────────────────────────── dfbab8b ──
#> ℹ undirected
#> ℹ 6 vertices · 5 edges
#>
#> ── Edges ───────────────────────────────────────────────────────────────────────
#> [1] 1 ─ 2 2 ─ 3 3 ─ 4 4 ─ 5 5 ─ 6
graph_(cbind(1:5, 2:6), from_edgelist(), directed = FALSE)
#> ── <igraph> ───────────────────────────────────────────────────────── 83184ad ──
#> ℹ undirected
#> ℹ 6 vertices · 5 edges
#>
#> ── Edges ───────────────────────────────────────────────────────────────────────
#> [1] 1 ─ 2 2 ─ 3 3 ─ 4 4 ─ 5 5 ─ 6
