Help with using the igraph and timeorded library in R

Asked

Viewed 186 times

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

Representação do arquivo graph.txt em forma de grafo temporal

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:

Grafo Agregado

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?

  • This is executable code :S I just tested, and it works.

  • Not without having the data Graph.txt... If you post the result of dput(g), it’s gonna get easier.

  • It says up there "Graph.txt":

  • 1

    It is, but when I put what’s there in a txt and try to read, the error in its code...

  • Try placing a new empty line at the end of the :D file

  • I have, but it has no name of columns...

  • Eiita Daniel!!! Put this at the beginning of the archive. In the first line: Vertexfrom Vertexto Timestart Timestop .

Show 3 more comments
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.