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)))
Domanda
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"
For example, 1) o1 --> i1 --> i9
2) o1 --> i1 --> i5
Is there some kind of network graph in R which I can readily make use of.
Thanks
Soluzione
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)))