1
I’m using the lib 'igraph' and 'timeorded' (http://www.benjaminblonder.org/timeorderednetworks/) to work with time graphs. I have the following time graph:
"graph.txt":
a c 1 1
a d 2 2
b d 2 2
c d 3 3
d b 3 3
My code:
library(igraph)
library(plyr)
library(timeordered)
g <- read.table("C:/Users/Filli/Desktop/testes/graph.txt", head= TRUE)
g <- generatetonetwork(g)
tdAll <- generatetimedeltas(1,4,3)
graphAgre <- generatenetworkslices(g, tdAll)
The variable graphAgre is the union of all graphs, from interval 1 to 3. It represents the following graph:
but when using the function 'Degree' for the graph 'graphAgre', gives me an error stating that the graphAgre variable is a list, not a graph. How I modify it to be graph, and thus calculate the degree?
*Use of the Gree function is required as I will also calculate closeness and betweenness.
**(graphAgre)
[[1]]
IGRAPH DNW- 4 5 --
+ attr: name (v/c), weight (e/n), Count (e/n)
+ edges (vertex names):
[1] a->c a->d b->d c->d d->b
**typeof(graphAgre)
[1] "list"
`
Unfortunately I’m not able to reproduce your problem. I’m not even able to rotate to where you create the
graphAgre
. You could edit your question by placing a playable code?– Daniel Falbel
This is executable code :S I just tested, and it works.
– Fillipe
Not without having the data Graph.txt... If you post the result of
dput(g)
, it’s gonna get easier.– Daniel Falbel
It says up there "Graph.txt":
– Fillipe
It is, but when I put what’s there in a txt and try to read, the error in its code...
– Daniel Falbel
Try placing a new empty line at the end of the :D file
– Fillipe
I have, but it has no name of columns...
– Daniel Falbel
Eiita Daniel!!! Put this at the beginning of the archive. In the first line: Vertexfrom Vertexto Timestart Timestop .
– Fillipe