More on {igraph}

A very simple example to understand how to make a graph network is from this tutorial: Networks in igraph

To understand a bit more about the graph structure we can use these functions:

g1 <- igraph::graph(edges=c(1,2, 2,3, 3, 1), n=3, directed=F ) 
## Warning: `graph()` was deprecated in igraph 2.1.0.
## ℹ Please use `make_graph()` instead.
## This warning is displayed once every 8 hours.
## Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
## generated.
E(g1); # access to the edges
## + 3/3 edges from 699cba9:
## [1] 1--2 2--3 1--3
V(g1); # the vertics
## + 3/3 vertices, from 699cba9:
## [1] 1 2 3
g1[] # access to the matrix
## 3 x 3 sparse Matrix of class "dgCMatrix"
##           
## [1,] . 1 1
## [2,] 1 . 1
## [3,] 1 1 .