我有一个邻接表,我想可视化它们并对其进行处理。有没有一个包可以有效地做到这一点。我看到有很多图形包,但其中有一些令人困惑。有人能帮我这个忙吗?
$`825`
[1] 824
$`824`
[1] 823
$`823`
[1] 822
$`822`
[1] 821
$`821`
[1] 820 777
$`820`
[1] 819 816 789 787 785 783
$`777`
[1] 776上面是邻接表。下面是我想要的图表。
825
|
824
| _______ 783
823 /
| /________ 785
822 /
| /__________ 787
821 -- 820
| \__________ 789
777 \
| \________ 816
776 \
\______ 819谢谢。
发布于 2013-04-05 19:58:49
mylist <- list(2,c(1,3),c(2,4),c(3,1))
names(mylist) <- c(1,2,3,4)
# just like your list
#make it in the igraph format
myadj <- stack(mylist)
#> values ind
#> 1 2 1
#> 2 1 2
#> 3 3 2
#> 4 2 3
#> 5 4 3
#> 6 3 4
#> 7 1 4
#plot it
library(igraph)
g<-graph.data.frame(myadj)
plot(g)https://stackoverflow.com/questions/15832674
复制相似问题