nodes <- data.frame(id = 1:3, group = c("B", "A", "B"))
edges <- data.frame(from = c(1,2), to = c(2,3))
network <- visNetwork(nodes, edges)
network
network %>% visSave(file = "network.html")
# same as
visSave(network, file = "network.html")
Run the code above in your browser using DataLab