Using networkD3 in R to create simple and clear Sankey diagrams
Published in
3 min readAug 19, 2018
I find Sankey diagrams super useful for illustrating flows of people or preferences. The networkD3
package in R offers a straightforward way to generate these diagrams without needing to know the ins and outs of the actual D3 code.
To show you what I mean, I generated a Sankey diagram to show how the twelve regions of the UK contributed to the overall result of the 2016 Brexit referendum, where voters chose to leave the European Union by 17,410,742 votes to 16,141,241.