library(magrittr)
# Create a graph with a directed tree
graph <-
create_graph() %>%
add_balanced_tree(2, 2)
# Convert this graph from directed to undirected
graph <-
graph %>% set_graph_undirected
# Perform a check on whether graph is directed
graph %>% is_graph_directed
#> [1] FALSE
Run the code above in your browser using DataLab