r - 常规图表有效,交互式显示空白
问题描述
我能够很好地生成常规图,但是由于某种原因,当我通过交互式绘图功能传递它时 - 有一个空白输出。
有谁知道我做错了什么?
library(igraph)
library(visNetwork)
#create relationships
data_a <-data.frame(
"source" = c("123","124","123","125","123"),
"target" = c("126", "123", "125", "122", "111"))
#create edges
Nodes <-data.frame(
"source" = c("123","124","125","122","111", "126"),
"Country" = c("usa", "uk", "uk", "usa", "uk", "usa"))
#create graph
graph_file <- data.frame(data_a$source, data_a$target)
graph <- graph.data.frame(graph_file, directed=F)
graph <- simplify(graph)
plot(graph)
#clustering
fc <- cluster_fast_greedy(graph)
contracted <- simplify(contract(graph,membership(fc)))
#plot works
plot(contracted)
#does not work
visIgraph(contracted) %>% visOptions (highlightNearest = TRUE)
解决方案
推荐阅读
- r - 如何将列矩阵附加到 dplyr 中的数据框?
- reactjs - api\login 500 错误 laravel/react 登录
- meteor - 在流星应用程序中更改导入文件后重新编译
- html - 比较使用两个不同版本的 IText(版本 2 和 7)生成的 PDF
- android - 使用 RxJava 取消改造请求
- android - 如何为地图添加填充?此处映射 Android SDK
- powershell - 带有从文本文件读取的 Image Magick Montage 的 Powershell
- python - 从列表 python2.7 中检索值
- javascript - 有条件地返回承诺或回调的包装函数
- javascript - 在 FormData 中传递和访问 JSON 对象和 CSV 文件