我有一个分层的非二进制树结构,表示为igraph
个对象。
library(igraph)
df = data.frame(subregion = c("Africa", "Europe", "Asia", "Namibia", "Kenya", "Egypt", "Belgium", "China", "India"),
region = c("World", "World", "World", "Africa", "Africa", "Africa", "Europe", "Asia", "Asia"))
df_graph = graph_from_data_frame(df, directed = F)
plot(df_graph, layout = layout_as_tree(df_graph, root = "World"))
有三个层次级别,同一级别的节点同样不同。现在我想将这个图形布局为扇形,就像你可以使用树形图一样:
df_graph_cl = cluster_fast_greedy(df_graph)
plot_dendrogram(df_graph_cl, type = "fan")
但是,节点之间的原始关系不会保留在树形图中,因为它是二进制树。关于如何将图形布局为扇形而不将其转换为树形图的任何想法?