edge | R Documentation |
This is a helper function that simplifies adding and deleting edges to/from graphs.
edge(...)
edges(...)
... |
See details below. |
edges()
is an alias for edge()
.
When adding edges via +
, all unnamed arguments of
edge()
(or edges()
) are concatenated, and then passed to
add_edges()
. They are interpreted as pairs of vertex ids,
and an edge will added between each pair. Named arguments will be
used as edge attributes for the new edges.
When deleting edges via -
, all arguments of edge()
(or
edges()
) are concatenated via c()
and passed to
delete_edges()
.
A special object that can be used with together with igraph graphs and the plus and minus operators.
Other functions for manipulating graph structure:
+.igraph()
,
add_edges()
,
add_vertices()
,
complementer()
,
compose()
,
connect()
,
contract()
,
delete_edges()
,
delete_vertices()
,
difference()
,
difference.igraph()
,
disjoint_union()
,
igraph-minus
,
intersection()
,
intersection.igraph()
,
path()
,
permute()
,
rep.igraph()
,
reverse_edges()
,
simplify()
,
union()
,
union.igraph()
,
vertex()
g <- make_ring(10) %>%
set_edge_attr("color", value = "red")
g <- g + edge(1, 5, color = "green") +
edge(2, 6, color = "blue") -
edge("8|9")
E(g)[[]]
g %>%
add_layout_(in_circle()) %>%
plot()
g <- make_ring(10) + edges(1:10)
plot(g)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.