简体   繁体   English

R中的网络可视化

[英]network visualization in r

I have the data like below to be visualized 我有如下数据可以可视化

Col1  Col2
o1     i1
o1     i2
o1     i3
o2     i1
i1     i9
i1     i5

I wanted the output to be a graph which would show me how each element in "Col1" is related to each element in "Col2" 我希望输出是一个图形,该图形将向我展示“ Col1”中的每个元素与“ Col2”中的每个元素如何相关

For example, 1) o1 --> i1 --> i9 例如1)o1-> i1-> i9
2) o1 --> i1 --> i5 Is there some kind of network graph in R which I can readily make use of. 2)o1-> i1-> i5 R中是否有某种我可以轻易使用的网络图。

Thanks 谢谢

For example like this: 例如这样:

df <- read.table(sep=" ", header=TRUE, text="
Col1 Col2
o1 i1
o1 i2
o1 i3
o2 i1
i1 i9
i1 i5")
require(igraph)
plot(graph.edgelist(as.matrix(df)))

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM