Skip to contents

The new graph will contain the same vertices, edges and attributes as the original graph, except that the direction of the edges selected by their edge IDs in the eids argument will be reversed. When reversing all edges, this operation is also known as graph transpose.

Usage

reverse_edges(graph, eids = E(graph))

# S3 method for igraph
t(x)

Arguments

graph

The input graph.

eids

The edge IDs of the edges to reverse.

x

The input graph.

Value

The result graph where the direction of the edges with the given IDs are reversed

Examples


g <- make_graph(~ 1 -+ 2, 2 -+ 3, 3 -+ 4)
reverse_edges(g, 2)
#> IGRAPH 2858c0a DN-- 4 3 -- 
#> + attr: name (v/c)
#> + edges from 2858c0a (vertex names):
#> [1] 1->2 3->2 3->4