el <- get.edgelist(g, names=FALSE)
On Mon, Oct 3, 2011 at 1:34 PM, S.M. Ali Abbas <address@hidden
> I have a directed graph 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?
dorm <- matrix(nc=2, get.vertex.attribute(g, "dorm", el))
gives you the "dorm" for the vertices along each edge.
Why not? Basically this is what I did above. You cannot run cor() on
> 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.
this, though, cor() is for numeric data.
> 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). How can I extract
> this information?
> igraph-help mailing list
Gabor Csardi <address@hidden> MTA KFKI RMKI
igraph-help mailing list