# 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")
# }
Run the code above in your browser using DataLab