Fixing the order of a Sankey flow graph in R / networkD3 package
问题 I would like to visualize a rank change (i.e. change of the relative order) of US states using a Sankey flow graph. I'm using the networkd3 package and came up with the following: library(dplyr) library(networkD3) df <- data_frame(origins=state.name[1:10], destinations=state.name[1:10]) lab <- c(df$origins, df$destinations) nodes <- data.frame(node=c(0:9), name=lab) links <- data.frame(source=c(0:9), target=c(10:19), value=rep(1,10)) sankeyNetwork(Links = links, Nodes = nodes, Source =