igraph-help
[Top][All Lists]
Advanced

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

Re: [igraph] Attaching attributes to networks


From: Tamás Nepusz
Subject: Re: [igraph] Attaching attributes to networks
Date: Sat, 15 Oct 2011 20:35:03 +0100

> Situation 2: Measures that outputs aren’t related to all nodes (e.g. 
> “articulation.points”). I tried to do the same illustrated in situation 1:   
> V(g)$articulation <- articulation.points(g). The problem is that the 
> attributes aren’t being attached to the exact vertexes. Is there any specific 
> syntax to deal with this kind of attribute attaching?
How about:

V(g)$attr <- 0
V(g)[articulation.points(g)]$attr <- 1

This assigns a 1 to the articulation points and 0 to the others. (Note: you 
might have to add 1 to the indexes returned by articulation.points, so check it 
before you try it).

> Situation 3: Measures related to graph attributes (e.g. “graph.density”). I 
> tried (g)<-graph.density(g), but it didn’t work. What is the syntax to attach 
> a graph attribute?
g$attr <- value

Cheers,
Tamas




reply via email to

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