Keegan Hines

vivagRaph: an R package for interactive network visualization

In a recent post, I explored the interconnectivity of the Austin Improv Network. Using the rvest package, it was quite easy to scrape the required information from the Austin Improv Wiki, and the culmination of this idea was this swirling, interactive network visualization. While the data collection and manipulation was done in R, I turned to the javascript library VivaGraph to make the interactive visualization. This library is great, but obviously it requires some comfort with javascript. To bridge this gap between R users and the VivaGraph library, I have developed the R package vivagRaph.

With the vivagRaph package, typical R objects can be used to automatically create the desired javascript visualization. As is shown below, the user can simply pass a few dataframes into the function vivagRaph(), and the required javascript objects and html are generated on the fly.

devtools::install_github('keeganhines/vivagRaph')
library(vivagRaph)
  
Nodes = data.frame(nodeName=c('Homer','Bart','Lisa','Milhouse','Lenny'), group=c(1,1,1,2,3))
Edges = data.frame(source=c(0,1,0,1,0),target=c(1,2,2,3,4))
vivagRaph(nodes=Nodes,edges=Edges)