Learn R Programming

DiagrammeR (version 0.7)

display_graph_object: Update and display graph object

Description

Using a dgr_graph object, update values of counts for nodes, edges, attributes, directed state, and display the schematic in the RStudio Viewer.

Usage

display_graph_object(graph, width = 400)

Arguments

graph
a dgr_graph object, created using the create_graph function.
width
the width of the graph representation in pixels.

Examples

Run this code
Create a simple graph and display a visual summary
of simple graph properties
nodes <-
  create_nodes(nodes = c("a", "b", "c", "d"),
               label = FALSE,
               type = "letter")

edges <-
  create_edges(from = c("a", "b", "c"),
               to = c("d", "c", "a"),
               relationship = "connected_to")

graph <- create_graph(nodes_df = nodes,
                      edges_df = edges)

display_graph_object(graph, width = 640)

Run the code above in your browser using DataLab