library(magrittr)
# Create a graph with 10 nodes
graph <-
create_graph() %>%
add_n_nodes(10)
# Add edges between nodes using a character string
graph <-
graph %>%
add_edges_w_string(
"1->2 1->3 2->4 2->5 3->6 3->7 4->8 4->9 5->10")
Run the code above in your browser using DataLab