For an analysis, I want to visualize movements between customer groups with a Sankey plot with the network3D:sankeyNetwork()
function. However, I encountered the following issue: in most cases, flows are between a source group (say group A) and a target group (say group B). However, How should we deal with the flow from B to A. Within the current set-up in the Sankey plot, another flow will be visualized. But if we have multiple groups with multiple flows (back and forth), the plot becomes messy and hard to interpret.
How to deal with these specific flows? Is in this specific case a Sankey plot the right visual? Or do we need something else?
Any help would be much appreciated. See sample code below.
library(networkD3)
library(dplyr)
#library(plotly)
links_2 <- tibble(
from = c(0, 1),
to = c(1, 0),
value = c(10, 20)
)
nodes_2 <- tibble(
nodes = c("a", "b")
)
links_2
nodes_2
# Make the Network
p <- sankeyNetwork(Links = links_2, Nodes = nodes_2,
Source = "from", Target = "to",
Value = "value", NodeID = "nodes",
fontSize=20)
p