Network Analysis in R
James Curley
Associate Professor, University of Texas at Austin
Undirected:
IGRAPH UN-- 7 7 --
+ attr: name (v/c)
+ edges (vertex names):
[1] A--B A--C A--D A--E A--F E--F F--G
Directed:
IGRAPH DN-- 7 7 --
+ attr: name (v/c)
+ edges (vertex names):
[1] A->E B->A C->A D->A F->A F->E F->G
is.directed(g)
[1] TRUE
is.weighted(g)
[1] FALSE
Is there an edge between A & E?
g['A','E']
[1] 1
Show all edges to or from A:
incident(g,'A', mode=c("all"))
+ 5/7 edges (vertex names):
[1] A->E B->A C->A D->A F->A
Find the starting vertex of all edges:
head_of(g, E(g))
+ 7/7 vertices, named:
[1] A B C D F F F
Network Analysis in R