我有下面的代码,它使用 r 包可视化网络visNetwork
。
library(visNetwork)
id<-c("articaine","benzocaine","etho","esli")
label<-c("articaine","benzocaine","etho","esli")
node<-data.frame(id,label)
from<-c("articaine","articaine","articaine","articaine","articaine","articaine","articaine","articaine","articaine")
to<-c("benzocaine","etho","esli","benzocaine","etho","esli","benzocaine","etho","esli")
title<-c("SCN1A","SCN1A","SCN1A","SCN2A","SCN2A","SCN2A","SCN3A","SCN3A","SCN3A")
edge<-data.frame(from,to,title)
visNetwork(nodes = node,edge)%>%
visOptions(highlightNearest=T, nodesIdSelection = T) %>%
# Specify that hover interaction and on-screen button navigations are active
visInteraction(hover = T, navigationButtons = T) %>%
visIgraphLayout(randomSeed = 997)
如果删除最后一行
%>%
visIgraphLayout(randomSeed = 997)
网络可视化是正确的
但是当添加时,我失去了一些边缘。
我需要该visIgraphLayout()
功能,因为它使我的真实网络看起来更好,并且复制速度也更快。为什么会发生这种情况?可能的解决方案?