Skip to contents

A pure constructor (no logging).

Usage

as_graph(x)

Arguments

x

an igraph object, a two-column edgelist matrix, or an adjacency matrix.

Value

an undirected igraph object.

Examples

el <- matrix(c(1, 2, 2, 3, 3, 1), ncol = 2, byrow = TRUE)
as_graph(el)
#> IGRAPH 1a056e1 U--- 3 3 -- 
#> + edges from 1a056e1:
#> [1] 1--2 1--3 2--3