Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

set_graph_undirected

Convert a directed 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

# 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()

DiagrammeR

Graph/Network Visualization

v1.0.6.1
MIT + file LICENSE
Authors
Richard Iannone [aut, cre] (<https://orcid.org/0000-0003-3925-190X>)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.