Last week, the guys from RStudio released Shiny, a neat new tool to create “interactive web applications”. It seems to focus on R users that are not very common with other languages than R and can help them to easily create web applications only using a few lines of code (look here for a comparism with gWidgetsWWW2.rapache) . The new package has been widely registered among the community with more than 70 retweets of the announcement tweet. Christopher Connell already showed a nice example of how to use it.
As Shiny is quite flexible and easy to handle, I decided to use it to build an interactive visualization tool for the Enron email data. I stumbled upon the data a while ago and updated it a little bit.
Visualizing the data using igraph looks quite nice. Each node is a former employee from Enron. The size of the nodes symbolizes the degree and edges stand for emails between two employees. Brighter edges show more email activity between the two nodes.
But the network is also very tight and it is hard to identify single connections between employees. That’s where Shiny comes into play:
Adding a drop-down field for choosing the type of mail (all, direct, cc, bcc) and two sliders for selecting nodes with a given degree and edges with a given weight. All of this took no longer than 2 hours including testing, debugging and polishing. Additionally, I added a second plot with community detection. This allows one to play around with the data and directly see the changes.
The code is available on github. Have fun playing around with my small example
The example is now also available on Rstudio’s server.