View source: R/set_graph_directed.R
set_graph_directed | R Documentation |
Take a graph which is undirected and convert it to a directed graph.
set_graph_directed(graph)
graph |
A graph object of class |
A graph object of class dgr_graph
.
# Create a graph with a
# undirected tree
graph <-
create_graph(
directed = FALSE) %>%
add_balanced_tree(
k = 2, h = 2)
# Convert this graph from
# undirected to directed
graph <-
graph %>%
set_graph_directed()
# Perform a check on whether
# graph is directed
graph %>% is_graph_directed()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.