当我使用VisNetwork的“群组”闪亮时,它可以正常形状工作。但是,当我为组使用字体真棒图标时,我无法对网络进行群集。我在网络的数据框中有两组。一个用于图标的组将节点分组。另一个组(称为群集)根据其分配的群集对节点进行分组。问题是,当我同时使用它们时,不会执行任何聚类。
这是我的代码:
library (igraph)
g <- erdos.renyi.game(100, 200, type = "gnm")
dummy <- toVisNetworkData(g)
my.edges <- dummy$edges; my.nodes <- dummy$nodes
my.nodes$group <- ifelse (my.nodes$id < 50, "A", "B")
my.nodes$clusters <- cluster_edge_betweenness((g),weights
= NULL)$membership
visNetwork(my.nodes, my.edges,
height = "700px", width = "100%",
main = "") %>%
visGroups(groupname = "A", shape = "icon",
icon = list(code = "f007")) %>%
visGroups(groupname = "B", shape = "icon",
icon = list(code = "f09d"))%>%
addFontAwesome()%>%
visClusteringByGroup(groups = c(my.nodes$clusters))
由于
答案 0 :(得分:1)
visClustering*
仍然是实验功能,尚未适应图标......