library(magrittr)
# Create an empty graph; by default, new graphs
# made by `create_graph()` are directed`
graph <-
create_graph()
# Determine whether the graph is directed
is_graph_directed(graph)
#> [1] TRUE
# Use the `set_graph_undirected()` function and
# check again whether the graph is directed
graph %>%
set_graph_undirected %>%
is_graph_directed
#> [1] FALSE
Run the code above in your browser using DataLab