Re: [R] vertex labels in igraph from adjacency matrix

2008-03-05 Thread Gabor Csardi
On Wed, Mar 05, 2008 at 02:27:21AM -0500, Charilaos Skiadas wrote: [...] Btw, you will likely want to take the betweenness call out, and call it once and store the result, instead of calling it twice (well, assuming the graph is largish). Or even better, use which.max:

Re: [R] vertex labels in igraph from adjacency matrix

2008-03-05 Thread Gabor Csardi
Mark, graph.adjacency always preserves the order of the vertices, so the vertex at row/column 1 will be vertex #0 in the igraph graph, etc. I'll document this in a minute. This means that you can always do g - graph.adjacency(A) V(g)$name - colnames(A) But i completely agree that this should

Re: [R] vertex labels in igraph from adjacency matrix

2008-03-05 Thread Mark W Kimpel
Looks like I turned an off my one error into an off by two error by adding rather than subtracting. Clearly a logic error on my part. Also, which.max is clearly superior as it results in half as many function calls. Thanks guys! As an aside, although igraph may use the C indexing convention,

[R] vertex labels in igraph from adjacency matrix

2008-03-04 Thread Mark W Kimpel
I am getting some unexpected results from some functions of igraph and it is possible that I am misinterpreting the vertex numbers. Eg., the max betweenness measure seems to be from a vertex that is not connected to a single other vertex. Below if my code snippet: require(igraph) my.graph -

Re: [R] vertex labels in igraph from adjacency matrix

2008-03-04 Thread Charilaos Skiadas
On Mar 5, 2008, at 1:39 AM, Mark W Kimpel wrote: I am getting some unexpected results from some functions of igraph and it is possible that I am misinterpreting the vertex numbers. Eg., the max betweenness measure seems to be from a vertex that is not connected to a single other vertex.