This is a more wonky thread about how I made this visualization in #Rstats using the awesome visNetwork

First step is to create the underlying network data. We need one file of "nodes" - i.e. the people and organizations. And one file of "edges" - i.e. the connections between them.

I created these by hand, based on excellent investigate journalism:
Now we can pull these together to create a network visualization!

You'll notice that I included a column for "type" in the nodes file. This allows me to use different icons for people vs firms vs political organizations.
All the icons are taken from @fontawesome. I *think* the visNetwork 📦 currently only works with fontawesome version 4.7, which is a bit limited – e.g. I decided to use a book icon to represent the fringe Evangelical Christian sect "Exclusive Brethren"! 😂
I very much enjoyed getting to use the "incognito" icon to represent all the unknown donors that have funded Tory MP Owen Paterson's overseas jaunts!
The icons are also scaled by how many "edges" connect to each "node".

Unsurprisingly, this means that the UK government and the Conservative party emerge as the most connected nodes in this network!
The great thing about visNetwork 📦 is that it's SO easy to make this visualization interactive with #RShiny.

You can add pop-up boxes ("tool-tips") that show more information when the user hovers over a node or edge – perfect for linking to the original reporting that I used.
Check out the full code and data on github! https://t.co/rWuCxbCnW3

More from Data science

To my JVM friends looking to explore Machine Learning techniques - you don’t necessarily have to learn Python to do that. There are libraries you can use from the comfort of your JVM environment. 🧵👇

https://t.co/EwwOzgfDca : Deep Learning framework in Java that supports the whole cycle: from data loading and preprocessing to building and tuning a variety deep learning networks.

https://t.co/J4qMzPAZ6u Framework for defining machine learning models, including feature generation and transformations, as directed acyclic graphs (DAGs).

https://t.co/9IgKkSxPCq a machine learning library in Java that provides multi-class classification, regression, clustering, anomaly detection and multi-label classification.

https://t.co/EAqn2YngIE : TensorFlow Java API (experimental)
Wellll... A few weeks back I started working on a tutorial for our lab's Code Club on how to make shitty graphs. It was too dispiriting and I balked. A twitter workshop with figures and code:


Here's the code to generate the data frame. You can get the "raw" data from https://t.co/jcTE5t0uBT


Obligatory stacked bar chart that hides any sense of variation in the data


Obligatory stacked bar chart that shows all the things and yet shows absolutely nothing at the same time


STACKED Donut plot. Who doesn't want a donut? Who wouldn't want a stack of them!?! This took forever to render and looked worse than it should because coord_polar doesn't do scales="free_x".

You May Also Like