[R] Correlation based on the attributes of vertices

Ali.Abbas m.ali.abbas at gmail.com
Tue Oct 4 14:52:48 CEST 2011


Dear all,
I have a directed graph - an Igraph to be more precise - which has some
vertices attributes (like dorm, year etc). Edges and the graph itself do not
have any attributes. Based on the attributes of the vertices, I'd like to
calculate correlation among the edges (e.g. how likely people of the same
dorm are connected?) for the whole graph. Also, I'd like to calculate
inter-attributes correlation for the whole graph (how correlated dorm and
year attributes are?)
Could you kindly tell how to go about it?
I thought of populating a list just like the graph edge list, and then
replacing each source and destination by its attribute value. For instance,
instead of the edge (0->1), I will replace it by (dorm_valueOf(0) ->
dorm_valueOf(1)) and then run the function /cor/ over it. It does not seem
like a nice solution.
On a side note, how does one get source and destination out of an edge list
by the Edge Iterator? For example, I'd like to know the source and the
target vertices' index of the first edge, E(graph)[0]. How can I extract
this information?

Thanks!

Best Regards,
Ali
P.S. I have already posted the same question on the igraph mailing list. On
receiving no response from there, I am posting it over here.

--
View this message in context: http://r.789695.n4.nabble.com/Correlation-based-on-the-attributes-of-vertices-tp3870844p3870844.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list