# Create a DiagrammeR graph object
dgr_graph_orig <-
create_graph() %>%
add_gnm_graph(
n = 36,
m = 50,
set_seed = 23)
# Convert the DiagrammeR
# graph to an igraph object
ig_graph <-
dgr_graph_orig %>%
to_igraph()
# Convert the igraph graph
# back to a DiagrammeR graph
dgr_graph_new <-
ig_graph %>%
from_igraph()
# Get some graph information
(dgr_graph_new %>%
get_graph_info())[, 1:6]
Run the code above in your browser using DataLab