Random Network App

Michał Parkoła
2021-11-10

Display a random graph using the visNetwork package

The app

Network creation and display code

library("visNetwork")
n <- input$numberOfNodes
nodes <- data.frame(id = 1:n)
edges <- data.frame(from = sample(1:10, n, replace = T),
                    to = sample(1:10, n, replace = T))
visNetwork::visNetwork(nodes, edges, width = "100%") 

Live code

I wanted to run the code to create the visualization inside this presentation but there seems to be a bug preventing visNetwork from drawing in Rpresentations (works fine in the console!), so instead I'm including this plot of the built in cars dataset:

plot of chunk unnamed-chunk-1

Learn Shiny!

Check out the wonderful guides and tutorials on appsilon.com and the Appsilon YouTube channel.