使用R进行网络的简单交互式可视化

时间:2017-10-18 15:55:58

标签: r plot

如果有一个简单的例子(数据见下文)我可以看到如下:

[![网络] [1] [1]

我的问题是,我想使用弹出窗口来显示更多信息(不适合图表)。问题是:我怎么能这样做? 我找到了很多东西,但是我无法让这个例子工作,这可能是因为我从来没有用Java编程。我还应该说,我不需要花哨/复杂的3D东西。只需一个弹出窗口即可完成任务!

非常感谢任何帮助!

链接:

  • presentation:我无法重现这个例子,我认为我不需要那么多。
  • tutorial第7.1章:我无法重现示例

这是数据

library(ggraph)
library(igraph)

nodes <- c("cool_fun", "mysum", "mydot", "myfun", "stupid_fun")
list_edges <- structure(list(
  cool_fun = structure(list(edges = character(0), 
                            weights = numeric(0)), 
                       .Names = c("edges", "weights")), 
  mysum = structure(list(edges = character(0), 
                         weights = numeric(0)), 
                    .Names = c("edges", "weights")), 
  mydot = structure(list(edges = character(0), 
                         weights = numeric(0)), 
                    .Names = c("edges", "weights")), 
  myfun = structure(list(edges = c("mysum", "mydot"), 
                         weights = c(1, 1)), 
                    .Names = c("edges", "weights")), 
  stupid_fun = structure(list(edges = character(0), 
                              weights = numeric(0)), 
                         .Names = c("edges", "weights"))), 
  .Names = c("cool_fun", "mysum", "mydot", "myfun", "stupid_fun"))

my_graph <- graph::graphNEL(nodes=nodes, edgeL=list_edges, edgemode = "directed")

plot(my_graph)

1 个答案:

答案 0 :(得分:1)

还有其他软件包可以让您制作网络图。尝试安装并使用visNetwork包。他们实际上在他们的主页面上有一个完全符合你想要的例子。

链接:

http://datastorm-open.github.io/visNetwork/

相关问题