render_graph {DiagrammeR} | R Documentation |
Using a dgr_graph
object,
render the graph in the RStudio Viewer.
render_graph(graph, output = NULL, layout = NULL, title = NULL, width = NULL, height = NULL)
graph |
a graph object of class
|
output |
a string specifying the output type;
|
layout |
a string specifying a layout type for
a |
title |
an optional title for a graph when
using |
width |
an optional parameter for specifying the width of the resulting graphic in pixels. |
height |
an optional parameter for specifying the height of the resulting graphic in pixels. |
## Not run: # Set a seed set.seed(24) # Create a node data frame (ndf) ndf <- create_node_df( n = 26, type = "basic", shape = sample(c("circle", "square"), length(1:26), replace = TRUE), fillcolor = sample(c("aqua", "orange", "pink", "lightgreen", "black", "yellow"), length(1:26), replace = TRUE)) # Create an edge data frame (edf) edf <- create_edge_df( from = sample(1:26, replace = TRUE), to = sample(1:26, replace = TRUE), rel = "to_node") # Create a graph object using the ndf and edf graph <- create_graph( nodes_df = ndf, edges_df = edf) # Render the graph using Graphviz render_graph(graph) # Render the graph using VivaGraph render_graph(graph, output = "vivagraph") # Render the graph using visNetwork render_graph(graph, output = "visNetwork") ## End(Not run)