linkdata:
from to freq
<int> <int> <int>
1 0 0 1
2 0 1 33
3 0 2 22
4 1 0 22
5 1 1 1
6 1 2 32
nodes = data.frame( names = unique(Data$names))%>%add_row(names = "other")
sankeyNetwork( Links = as.data.frame( linkdata), Nodes = nodes, Source = "from",
Target = "to", Value = "freq" , NodeID = "names",
fontSize = 12, nodeWidth = 30)
未显示绘图。我已经基于StackOverflow的答案在节点中添加了新行,即使那行不通。
数据仅包含一些我想在sunkey图中命名标签的名称。
names
1 a
2 b
3 c
4 d
5 e
6 f
7 other