Reverse the direction of all edges in a graph
Using a directed graph as input, reverse the direction of all edges in that graph.
rev_edge_dir(graph)
graph |
A graph object of class |
A graph object of class dgr_graph
.
Other Edge creation and removal:
add_edge_clone()
,
add_edge_df()
,
add_edges_from_table()
,
add_edges_w_string()
,
add_edge()
,
add_forward_edges_ws()
,
add_reverse_edges_ws()
,
copy_edge_attrs()
,
create_edge_df()
,
delete_edges_ws()
,
delete_edge()
,
delete_loop_edges_ws()
,
drop_edge_attrs()
,
edge_data()
,
join_edge_attrs()
,
mutate_edge_attrs_ws()
,
mutate_edge_attrs()
,
recode_edge_attrs()
,
rename_edge_attrs()
,
rescale_edge_attrs()
,
rev_edge_dir_ws()
,
set_edge_attr_to_display()
,
set_edge_attrs_ws()
,
set_edge_attrs()
# Create a graph with a # directed tree graph <- create_graph() %>% add_balanced_tree( k = 2, h = 2) # Inspect the graph's edges graph %>% get_edges() # Reverse the edge directions # such that edges are directed # toward the root of the tree graph <- graph %>% rev_edge_dir() # Inspect the graph's edges # after their reversal graph %>% get_edges()
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.