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

to_igraph

Convert a DiagrammeR graph to an igraph one


Description

Convert a DiagrammeR graph to an igraph graph object.

Usage

to_igraph(graph)

Arguments

graph

A graph object of class dgr_graph.

Value

An igraph object.

Examples

# Create a random graph using the
# `add_gnm_graph()` function
graph <-
  create_graph() %>%
  add_gnm_graph(
    n = 36,
    m = 50,
    set_seed = 23)

# Confirm that `graph` is a
# DiagrammeR graph by getting
# the object's class
class(graph)

# Convert the DiagrammeR graph
# to an igraph object
ig_graph <- to_igraph(graph)

# Get the class of the converted
# graph, just to be certain
class(ig_graph)

# Get a summary of the igraph
# graph object
summary(ig_graph)

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.