DiagrammeR (version 0.9.2)

set_graph_undirected: Convert graph to an undirected graph

Description

Take a graph which is directed and convert it to an undirected graph.

Usage

set_graph_undirected(graph)

Arguments

graph

a graph object of class dgr_graph.

Value

a graph object of class dgr_graph.

Examples

Run this code
# NOT RUN {
# Create a graph with a directed tree
graph <-
  create_graph() %>%
  add_balanced_tree(
    k = 2, h = 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 DataCamp Workspace