nodes <- data.frame(id = 1:10)
edges <- data.frame(from = round(runif(8)*10), to = round(runif(8)*10))
visNetwork(nodes, edges) %>%
visHierarchicalLayout()
visNetwork(nodes, edges) %>%
visHierarchicalLayout(direction = "LR")
Run the code above in your browser using DataLab