r - modified sankey Plot with several edges between nodes -
i make modified sankey plot in r, possible have several edges between nodes, identify different paths. bit hard explain made sample picture in ppt :)
i know ugly :) point able make edges between , b1, , indicate edge belongs path going c1 , c2.
i tried sankeyplot rcharts-packages, 2 columns of nodes.
i have tried riverplot-packages, here can not make 2 edges between same nodes.
you can use diagrammer graphviz graph , html table labels:
library(diagrammer) g1 <- 'digraph structs { b1_node [label=< <table border="0" cellborder="1" cellspacing="0"> <tr><td port="one">b one</td></tr> <tr><td port="two">b two</td></tr> </table> > ]; -> b1_node:one; -> b1_node:two; -> b2; b1_node:one -> c1; b1_node:two -> c2; b2 -> c3; rankdir=lr }' grviz(g1)
see diagrammer/graphviz , graphviz/node shapes documentation.
sankey version
you use sankey diagram have split node b1:
links <- data.frame( source = c("a", "a", "b1", "b1", "a", "b1a", "b1b", "b2" ), target =c("b1", "b1", "b1a", "b1b", "b2", "c1", "c2", "c3"), value = c(20, 20, 20, 20, 30, 20, 20, 30) )
Comments
Post a Comment