igraph-help
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [igraph] extracting vertex attributes from an family of graphs


From: Gábor Csárdi
Subject: Re: [igraph] extracting vertex attributes from an family of graphs
Date: Thu, 10 Apr 2014 12:45:29 -0400

On Thu, Apr 10, 2014 at 12:31 PM, Bob Pap <address@hidden> wrote:
Dear all,

Unaware of any method for dealing with multigraphs (in my case a family of graphs "g" indexed by time), I handle these by creating a list, indexed by the time period, say "Mygraphs", where Mygraphs[["2014-01-01"]] returns graph g as it was in 2014-01-01.

I face the need to extract a combination of attributes from the series (in the example below the vertex's "id" and "betweeness", ordered by the index of Mygraphs), I do so for example as follows:

sapply(
Mygraphs,
function(g,id="identifierXX",attr="betweeness") {
get.vertex.attribute(induced.subgraph(g, which(V(g)$name==id)),attr)
}
)

I cannot help to think that the use of induced.subgraph could be obviated by specifying the 2 dimensions (id and attr) at once in the extraction, but I how would I restrict get.vertex.attribute to only return the value for vertex "identifierXX" only?

See the 'index' argument of 'get.vertex.attribute'. 
http://igraph.org/r/doc/attributes.html

Gabor
 

Any guidance would be appreciated.
Kindly,
Bob Pap

_______________________________________________
igraph-help mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/igraph-help



reply via email to

[Prev in Thread] Current Thread [Next in Thread]