Description Usage Arguments Value See Also Examples

`graph_from_edgelist`

creates a graph from an edge list. Its argument
is a two-column matrix, each row defines one edge. If it is
a numeric matrix then its elements are interpreted as vertex ids. If
it is a character matrix then it is interpreted as symbolic vertex
names and a vertex id will be assigned to each name, and also a
`name`

vertex attribute will be added.

1 2 3 | ```
graph_from_edgelist(el, directed = TRUE)
from_edgelist(...)
``` |

`el` |
The edge list, a two column matrix, character or numeric. |

`directed` |
Whether to create a directed graph. |

`...` |
Passed to |

An igraph graph.

Other determimistic constructors: `atlas`

,
`graph.atlas`

,
`graph_from_atlas`

;
`chordal_ring`

,
`graph.extended.chordal.ring`

,
`make_chordal_ring`

;
`directed_graph`

, `graph`

,
`graph.famous`

,
`make_directed_graph`

,
`make_graph`

,
`make_undirected_graph`

,
`undirected_graph`

;
`empty_graph`

, `graph.empty`

,
`make_empty_graph`

;
`from_literal`

, `graph.formula`

,
`graph_from_literal`

;
`full_citation_graph`

,
`graph.full.citation`

,
`make_full_citation_graph`

;
`full_graph`

, `graph.full`

,
`make_full_graph`

;
`graph.lattice`

, `lattice`

,
`make_lattice`

; `graph.ring`

,
`make_ring`

, `ring`

;
`graph.star`

, `make_star`

,
`star`

; `graph.tree`

,
`make_tree`

, `tree`

1 2 3 4 5 | ```
el <- matrix( c("foo", "bar", "bar", "foobar"), nc = 2, byrow = TRUE)
graph_from_edgelist(el)
# Create a ring by hand
graph_from_edgelist(cbind(1:10, c(2:10, 1)))
``` |

```
Attaching package: 'igraph'
The following objects are masked from 'package:stats':
decompose, spectrum
The following object is masked from 'package:base':
union
IGRAPH DN-- 3 2 --
+ attr: name (v/c)
+ edges (vertex names):
[1] foo->bar bar->foobar
IGRAPH D--- 10 10 --
+ edges:
[1] 1-> 2 2-> 3 3-> 4 4-> 5 5-> 6 6-> 7 7-> 8 8-> 9 9->10 10-> 1
```

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.