Examples for 'igraph::add_edges'


Add edges to a graph

Aliases: add_edges add.edges

Keywords:

### ** Examples

g <- make_empty_graph(n = 5) %>%
  add_edges(c(1,2, 2,3, 3,4, 4,5)) %>%
  set_edge_attr("color", value = "red") %>%
  add_edges(c(5,1), color = "green")
E(g)[[]]
+ 5/5 edges from fd32904:
  tail head tid hid color
1    1    2   1   2   red
2    2    3   2   3   red
3    3    4   3   4   red
4    4    5   4   5   red
5    5    1   5   1 green
plot(g)
plot of chunk example-igraph-add_edges-1

[Package igraph version 1.3.1 Index]