DiagrammeR (version 0.9.0)

from_igraph: Convert an igraph graph to a DiagrammeR one

Description

Convert an igraph graph to a DiagrammeR graph object.

Usage

from_igraph(igraph, write_backups = FALSE)

Arguments

igraph

an igraph graph object.

write_backups

an option to write incremental backups of changing graph states to disk. If TRUE, a subdirectory of the working directory will be used to store RDS files. The default value is FALSE so one has to opt in to use this functionality.

Value

a graph object of class dgr_graph.

Examples

Run this code
# NOT RUN {
# Create a DiagrammeR graph object
dgr_graph_orig <-
  create_random_graph(
    36, 50, set_seed = 1,
    directed = TRUE)

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

# Convert the igraph graph back to a
# DiagrammeR graph
dgr_graph_new <- from_igraph(ig_graph)
# }

Run the code above in your browser using DataLab