# Create a simple edge data frame (edf) and
# view the results
edges <-
create_edges(
from = c(1, 2, 3),
to = c(4, 3, 1),
rel = "a")
# Display the `edges` edf
edges
#> from to rel
#> 1 1 4 a
#> 2 2 3 a
#> 3 3 1 a
# Render the graph to make it viewable in
# the Viewer pane
render_graph(
create_graph(edges_df = edges),
output = "visNetwork")
# Create an edge data frame with several
# additional parameters
edges <-
create_edges(
from = c(1, 2, 3),
to = c(4, 3, 1),
rel = "a",
length = c(50, 100, 250),
color = "green",
width = c(1, 5, 2))
# Render the graph to make it viewable in
# the Viewer pane
render_graph(
create_graph(edges_df = edges),
output = "visNetwork")
Run the code above in your browser using DataLab