The double bracket operator can be used on edge sequences, to print the meta-data (edge attributes) of the edges in the sequence.
Details
Technically, when used with edge sequences, the double bracket operator does exactly the same as the single bracket operator, but the resulting edge sequence is printed differently: all attributes of the edges in the sequence are printed as well.
See [.igraph.es
for more about indexing edge sequences.
See also
Other vertex and edge sequences:
E()
,
V()
,
as_ids()
,
igraph-es-attributes
,
igraph-es-indexing
,
igraph-vs-attributes
,
igraph-vs-indexing
,
igraph-vs-indexing2
,
print.igraph.es()
,
print.igraph.vs()
Other vertex and edge sequence operations:
c.igraph.es()
,
c.igraph.vs()
,
difference.igraph.es()
,
difference.igraph.vs()
,
igraph-es-indexing
,
igraph-vs-indexing
,
igraph-vs-indexing2
,
intersection.igraph.es()
,
intersection.igraph.vs()
,
rev.igraph.es()
,
rev.igraph.vs()
,
union.igraph.es()
,
union.igraph.vs()
,
unique.igraph.es()
,
unique.igraph.vs()
Examples
g <- make_(
ring(10),
with_vertex_(name = LETTERS[1:10]),
with_edge_(weight = 1:10, color = "green")
)
E(g)
#> + 10/10 edges from d810169 (vertex names):
#> [1] A--B B--C C--D D--E E--F F--G G--H H--I I--J A--J
E(g)[[]]
#> + 10/10 edges from d810169 (vertex names):
#> tail head tid hid weight color
#> 1 A B 1 2 1 green
#> 2 B C 2 3 2 green
#> 3 C D 3 4 3 green
#> 4 D E 4 5 4 green
#> 5 E F 5 6 5 green
#> 6 F G 6 7 6 green
#> 7 G H 7 8 7 green
#> 8 H I 8 9 8 green
#> 9 I J 9 10 9 green
#> 10 A J 1 10 10 green
E(g)[[.inc("A")]]
#> + 2/10 edges from d810169 (vertex names):
#> tail head tid hid weight color
#> 1 A B 1 2 1 green
#> 10 A J 1 10 10 green